Re: [Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread Bryan Van de Ven
otypes needs to be set for this to work. In [19]: vstrip = vectorize( string.strip, otypes=[object]) In [20]: s = [' aa ' , ' bb ', ' cc '] In [21]: vstrip(s) Out[21]: array([aa, bb, cc], dtype=object)

Re: [Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread lorenzo bolla
Yes, 32 bits. On a 64 bits machine, I get 8 characters long strings like you. L. On 1/9/08, David Huard <[EMAIL PROTECTED]> wrote: > > Lorenzo, > > 2008/1/9, lorenzo bolla <[EMAIL PROTECTED]>: > > > > I don't think it's expected: mine are cropped to 4 characters! > > > > > I am on a 64 bit machin

Re: [Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread David Huard
Lorenzo, 2008/1/9, lorenzo bolla <[EMAIL PROTECTED]>: > > I don't think it's expected: mine are cropped to 4 characters! > I am on a 64 bit machine. Are you on a 32 bit one ? In [101]: vstrip = vectorize( string.strip) > In [102]: s = [' aa ' , ' bb ', ' > c

Re: [Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread lorenzo bolla
I don't think it's expected: mine are cropped to 4 characters! In [101]: vstrip = vectorize( string.strip) In [102]: s = [' aa ' , ' bb ', ' cc '] In [103]: vstrip(s) Out[103]: array(['', '', ''], dtype='|S4') You can obviously use "

[Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread David Huard
Hi all, I'm having trouble understanding the behavior of vectorize on the following example: >>> import string >>> from numpy import vectorize >>> vstrip = vectorize(string.strip) >>> s = [' aa ' , ' bb ', ' cc '] >>> vstrip(s) array(['', 'b