Hello all,
If my function receives an array with a flexible dtype such as string or 
unicode, how do I find out what the size (max number of elements, not number of 
bytes) of the datatype is?

For example:
>>> x = np.array(['a', 'b', 'cd'], (np.unicode_, 4))
>>> x.dtype
dtype('<U4')

The string representation of x.dtype shows that is has element size 4, so I 
could get the element size by parsing that, but is there a more elegant way to 
get this?
Thanks,
Koert

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to