8000 chararray.rstrip inconsistency (Trac #1200) · Issue #1798 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

chararray.rstrip inconsistency (Trac #1200) #1798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thouis opened this issue Oct 19, 2012 · 2 comments
Closed

chararray.rstrip inconsistency (Trac #1200) #1798

thouis opened this issue Oct 19, 2012 · 2 comments

Comments

@thouis
Copy link
Contributor
thouis commented Oct 19, 2012

Original ticket http://projects.scipy.org/numpy/ticket/1200 on 2009-08-19 by trac user dgoldsmith, assigned to unknown.

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 '

@thouis
Copy link
Contributor Author
thouis commented Oct 19, 2012

@mdboom wrote on 2009-10-12

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.

This bug should probably be marked as "won't fix"

@thouis
Copy link
Contributor Author
thouis commented Oct 19, 2012

@charris wrote on 2010-04-24

I'm going to follow mdroe's recommendation and close this ticket as "won't fix".

@thouis thouis closed this as completed Oct 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0