You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c = np.array([' aA '], dtype='S6').view(np.chararray); c
chararray([' aA'],
dtype='|S6')
len(c[0]) # is 'A' the trailing character...
4
c.rstrip('A') # ...or not?
chararray([' aA'],
dtype='|S6')
Note:
len(c.base[0]); c.base[0]
6
' aA '
Consequent hypothesis: rstrip is operating on c.base, not c.
len(c.base[0]); c.base[0]
6
' aA '
The text was updated successfully, but these errors were encountered:
This inconsistency is the unfortunate cost of backward compatibility with numarray.
As of SVN r1714, there is a refactoring of the chararray functionality, and the vectorized string operations are available as free functions, negating the need for the chararray class. This should be the way forward for new code.
Original ticket http://projects.scipy.org/numpy/ticket/1200 on 2009-08-19 by trac user dgoldsmith, assigned to unknown.
Note:
Consequent hypothesis: rstrip is operating on c.base, not c.
The text was updated successfully, but these errors were encountered: