A Thursday 27 May 2010 05:52:22 Vincent Davis escrigué:
> How do I determine if an array's (or column in a structured array) dtype isI suppose that the `.kind` attribute of dtype would help you:
> a number or a string. I see how to determine the actual dtype but all I
> want to know is if it is a string or a number.
In [2]: s = np.dtype("S3")
In [4]: s.kind
Out[4]: 'S'
In [5]: i = np.dtype("i4")
In [6]: i.kind
Out[6]: 'i'
In [7]: f = np.dtype("f8")
In [8]: f.kind
Out[8]: 'f'
Pierre GM "Check `numpy.lib._iotools._is_string_like`"
--
Francesc Alted
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Vincent Davis | ||