Re: [Numpy-discussion] array with object

2006-11-30 Thread Robert Kern
Lionel Roubeyrie wrote: > Hi Torgil, > strange, I don't have the same error: > > |~|[2]>array(['2'],dtype=float32) > --- > exceptions.ValueErrorTraceback

Re: [Numpy-discussion] array with object

2006-11-30 Thread Lionel Roubeyrie
Hi Torgil, strange, I don't have the same error: |~|[2]>array(['2'],dtype=float32) --- exceptions.ValueErrorTraceback (most recent call last) /home/lione

Re: [Numpy-discussion] array with object

2006-11-29 Thread Christopher Barker
Torgil Svensson wrote: > It works if you replace the strings '2','3','5','6' with numbers instead. duh! I can't believe I didn't see that! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (2

Re: [Numpy-discussion] array with object

2006-11-29 Thread Torgil Svensson
It works if you replace the strings '2','3','5','6' with numbers instead. This case got a better error-message: >>> array(['2'],dtype=float32) Traceback (most recent call last): File "", line 1, in ? TypeError: a float is required //Torgil On 11/29/06, Lionel Roubeyrie <[EMAIL PROTECTED]> wr

Re: [Numpy-discussion] array with object

2006-11-29 Thread Christopher Barker
Lionel Roubeyrie wrote: > Hi all, > I don't understand why can't I do that: > b=array([(datetime.datetime(2006,11,29),'2','3'), > (datetime.datetime(2006,11,30),'5','6')], dtype=[('Dates', 'object'), > ('HUM', 'float32'), ('TEM', 'float32')]) > ValueError: tried to set void-array with object member

[Numpy-discussion] array with object

2006-11-29 Thread Lionel Roubeyrie
Hi all, I don't understand why can't I do that: b=array([(datetime.datetime(2006,11,29),'2','3'), (datetime.datetime(2006,11,30),'5','6')], dtype=[('Dates', 'object'), ('HUM', 'float32'), ('TEM', 'float32')]) ValueError: tried to set void-array with object members using buffer. Thanks -- Lionel R