[Numpy-discussion] Failing to understand vectorize behavior

David Huard david.huard@gmail....
Wed Jan 9 08:41:24 CST 2008


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 = ['  aaaaaaaaaaaaaa  ' , ' bbbbbbbbbbbbbbbbbb  ', '
cccccccccccccccccc ']
>>> vstrip(s)
array(['aaaaaaaa', 'bbbbbbbb', 'cccccccc'],
      dtype='|S8')

where all strings are cropped to 8 characters.
Is this expected ?


Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080109/1ce413ba/attachment.html 


More information about the Numpy-discussion mailing list