[Numpy-discussion] Why stripping spaces in strings?

Francesc Alted falted at openlc.org
Thu Sep 11 03:58:58 CDT 2003


Yups, RawCharrArray do the trick:

>>> strings.array([["hello world  ","pp\0"]], kind=strings.CharArray)
CharArray([['hello world', 'pp']])
>>> strings.array([["hello world  ","pp\0"]], kind=strings.RawCharArray)
RawCharArray([['hello world  ', 'pp\x00          ']])

Thanks for the hint,

A Dimecres 10 Setembre 2003 14:40, Todd Miller va escriure:
> Take a look at RawCharArray instead of CharArray.  CharArray is a
> RawCharArray with specific stripping and padding behaviors and some
> extra methods.  RawCharArray should be the starting point for this kind
> of discussion;  it may do what you want as-is, or you can tell me where
> it's falling short of what you need.
>
> Todd

-- 
Francesc Alted





More information about the Numpy-discussion mailing list