Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Vincent Davis
On Thu, May 27, 2010 at 10:25 AM, Bruce Southey wrote: > On 05/27/2010 10:40 AM, Vincent Davis wrote: > Can you give an example of what you are trying to do? > arr = np.array([(1,'a'),(2,'b')], dtype =[(num,int),(str, |s2)] No supposed I want to know if I can sum the values in 'num'. I could j

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Bruce Southey
On 05/27/2010 10:40 AM, Vincent Davis wrote: On Thu, May 27, 2010 at 8:39 AM, Keith Goodman > wrote: To see if it is a number could you use something like: np.issubdtype(a.dtype, float) or np.issubdtype(a.dtype, int) or np.issubdtype(a.dtype, complex)

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Robert Kern
On Thu, May 27, 2010 at 11:40, Vincent Davis wrote: > > On Thu, May 27, 2010 at 8:39 AM, Keith Goodman wrote: >> >> To see if it is a number could you use something like: >> np.issubdtype(a.dtype, float) or np.issubdtype(a.dtype, int) or >> np.issubdtype(a.dtype, complex) >> >> And for string: >>

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Vincent Davis
On Thu, May 27, 2010 at 8:39 AM, Keith Goodman wrote: > To see if it is a number could you use something like: > > np.issubdtype(a.dtype, float) or np.issubdtype(a.dtype, int) or > np.issubdtype(a.dtype, complex) > > And for string: > > np.issubdtype(a.dtype, str) > These are valid but what I do

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Keith Goodman
On Thu, May 27, 2010 at 6:02 AM, Vincent Davis wrote: > > On Thu, May 27, 2010 at 1:27 AM, Francesc Alted wrote: >> >> 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 is >> > a number or a string. I see how to d

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Vincent Davis
On Thu, May 27, 2010 at 1:27 AM, Francesc Alted wrote: > 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 > is > > a number or a string. I see how to determine the actual dtype but all I > > want to know is if it

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-27 Thread Francesc Alted
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 is > 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. I suppose that the `.kind` attribute of

Re: [Numpy-discussion] How to distinguish between number and string dypes

2010-05-26 Thread Pierre GM
On May 26, 2010, at 11:52 PM, Vincent Davis wrote: > > How do I determine if an array's (or column in a structured array) dtype is 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. Check `numpy.lib._iotools._is_string_like

[Numpy-discussion] How to distinguish between number and string dypes

2010-05-26 Thread Vincent Davis
How do I determine if an array's (or column in a structured array) dtype is 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. *Vincent Davis 720-301-3003 * vinc...@vincentdavis.net my blog | LinkedIn<