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 inconsistent for CategoricalIndex #20842

h-vetinari opened this Issue Apr 27, 2018 · 2 comments


None yet
2 participants

h-vetinari commented Apr 27, 2018

The works for CategoricalIndex as target, but not as caller. This is inconsistent.

a = pd.Index(['a', 'b', 'a'])
b = pd.Index(['a', 'b', 'a'], dtype='category')
# Index(['aa', 'bb', 'aa'], dtype='object')
# AttributeError: Can only use .str accessor with string values (i.e. inferred_type is 'string', 'unicode' or 'mixed')

This comment has been minimized.


WillAyd commented Apr 30, 2018

Why wouldn't you just rename your categories?


This comment has been minimized.


h-vetinari commented Apr 30, 2018

this was just a toy example - if there's more to concatenate, it gets more unwieldy. But more than that, it makes no sense that works, but doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment