[Numpy-discussion] Type checking of arrays containing strings

Arnar Flatberg arnar.flatberg@gmail....
Fri Jul 18 03:49:56 CDT 2008


I need to check if my array (a) is of type `string`. That is, I dont know
the number of characters beforehand, so I cant do a.dtype == '|S*' (* =
(max) number of characters)
Looking at my options,  I see either a.dtype.kind == 'S' or a.dtype.type ==
np.string_, might be ok. Are these any of the preffered ways, or is there
some other way?


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

More information about the Numpy-discussion mailing list