-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
API: Categorical constructor shouldn't accept scalar for categories #16022
Labels
Comments
we generally do this, iow, accept scalars in list-like fields. So ok with this (also ok is to raise a ValueError). Maybe that would be better. |
I would just raise an error on this, no reason to allow it IMO (and I would just regard it as a bug fix without deprecation, or would there be people doing this?) |
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
May 12, 2017
Categorical constructor no longer accepts scalars for categories. Closes pandas-dev#16022
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
May 12, 2017
Categorical constructor no longer accepts scalars for categories. Closes pandas-dev#16022
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
May 16, 2017
Categorical constructor no longer accepts scalars for categories. Closes pandas-dev#16022
TomAugspurger
added a commit
that referenced
this issue
May 16, 2017
* BUG: Categorical constructor scalar categories Categorical constructor no longer accepts scalars for categories. Closes #16022
pcluo
pushed a commit
to pcluo/pandas
that referenced
this issue
May 22, 2017
* BUG: Categorical constructor scalar categories Categorical constructor no longer accepts scalars for categories. Closes pandas-dev#16022
stangirala
pushed a commit
to stangirala/pandas
that referenced
this issue
Jun 11, 2017
* BUG: Categorical constructor scalar categories Categorical constructor no longer accepts scalars for categories. Closes pandas-dev#16022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
I was surprised to find that
Categorical
accepts scalars forcategories
.AFAICT, this isn't documented, though we explicitly test it here. Am I missing a use-case where this is desirable, or should we just depreciate it and simplify the constructor?
Anyone want to guess what the categories are on
pd.Categorical(['a', 'b'], categories='abcd')
:)cc @JanSchulz
The text was updated successfully, but these errors were encountered: