[Numpy-discussion] Casting a float array into a string array

Matthieu Brucher matthieu.brucher@gmail....
Fri Oct 5 03:51:03 CDT 2007


I'm trying to cast a float array into a string array (for instance
transforming [[2., 3.], [4., 5.]] into [['2.', '3.'], ['4.', '5.']]), I
tried with astype(str) and every variation (str_, string, string_, string0),
but not luck.
Is there a function or a method of the array class that can fulfill my needs
? And if there is a way to add a formatting option ('1.1f' for instance), it
would be even better.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20071005/669e51e0/attachment.html 

More information about the Numpy-discussion mailing list