[Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Arnar Flatberg
Hi 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

Re: [Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Stéfan van der Walt
2008/7/18 Arnar Flatberg [EMAIL PROTECTED]: 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 ==

Re: [Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Arnar Flatberg
On Fri, Jul 18, 2008 at 11:40 AM, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/7/18 Arnar Flatberg [EMAIL PROTECTED]: 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

Re: [Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Arnar Flatberg
On Fri, Jul 18, 2008 at 12:38 PM, Arnar Flatberg [EMAIL PROTECTED] wrote: On Fri, Jul 18, 2008 at 11:40 AM, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/7/18 Arnar Flatberg [EMAIL PROTECTED]: I need to check if my array (a) is of type `string`. That is, I dont know the number of

Re: [Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Stéfan van der Walt
2008/7/18 Arnar Flatberg [EMAIL PROTECTED]: ... and instead of just complaining, I can do something about it :-) Could you add permissions to me for the documentation editor, username: That's the spirit! You are now added. But I'm worried: I had a bet with Joe that we won't get more than 30