On Oct 26, 2009, at 9:54 AM, Eli Bressert wrote:

Hi Everyone,

Is Numpy supposed to behave this like this when converting an array of
numbers to an array of strings with astype?

In general you have to tell NumPy how big the string should be (i.e. np.str is generic).

There are a few places where NumPy will look at the data you have in order to guess a size, but as you've seen astype is not one of those places.

I think astype could be fixed (by putting a special-case check in the current code for conversion to an unspecified-length string), but that has not been implemented.

Please file a feature enhancement issue on the Trac so we don't lose sight of this.

-Travis





_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to