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)
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
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
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 "
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