[Numpy-discussion] missing string formatting functionality?
Mon Jul 19 09:58:03 CDT 2010
On Thu, Jul 15, 2010 at 7:53 AM, Neal Becker <firstname.lastname@example.org> wrote:
> It looks like np.savetxt is pretty flexible, accepting fmt, and delimiter
> args. But to format into a string, we have array_repr and array_str, which
> are not flexible.
> Of course, one can use np.savetxt with python stringio, but that's more
> work. Would be nice if np.savetxt could just return a string. Better
> still, if np.savestring (returning a string) would implement core
> functionality, and np.savetxt would just us it.
At first, I was thinking that this might not be a bad idea, however, on
second thought there might be memory issues. Probably not huge memory
issues, but depending on the amount of data, it might be too costly in the
general use case. I would guess that doing a StringIO approach would
probably be better than reworking savetxt. Because savetxt already accepts
a file-like object, StringIO fits very nicely to the existing numpy
My 2 cents...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion