[Numpy-discussion] numpy.savetxt Ticket 1573 - suggested fix

Paul Anton Letnes paul.anton.letnes@gmail....
Sun Aug 7 15:11:38 CDT 2011


(A pull request has been submitted on github, but I'm posting here so people can discuss the user interface issues.)

As of now, the fmt= kwarg kan be (for complex dtype):
a) a single specifier, fmt='%.4e', resulting in numbers formatted like ' (%s+%sj)' % (fmt, fmt)
b) a full string specifying every real and imaginary part, e.g. ' %.4e %+.4j' * 3 for 3 columns
c) a list of specifiers, one per column - in this case, the real and imaginary part must have separate specifiers, e.g. ['%.3e + %.3ej', '(%.15e%+.15ej)']

It would be good if people could air their opinion as to whether this is what they would expect from savetxt behavior for real (float) numbers.

Ticket link:
http://projects.scipy.org/numpy/ticket/1573

Cheers,
Paul


More information about the NumPy-Discussion mailing list