-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Categorical dtype doesn't survive groupby of first, max, min, value_counts etc.: unwanted coercion to object #18502
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
Labels
Categorical
Categorical Data Type
Dtype Conversions
Unexpected or buggy dtype conversions
Enhancement
Groupby
Milestone
Comments
I suppose. This would require a fair amount of work on this type of preservation as these routines are in cython. Would hold be able to work for the non-numerical filters (first,last,min,max). If you want to submit a PR would be accepted. note 3.4 is not longer supported FYI. |
jreback
added a commit
to jreback/pandas
that referenced
this issue
May 29, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502
jreback
added a commit
to jreback/pandas
that referenced
this issue
May 29, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
May 29, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
May 29, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
May 30, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 2, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 8, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 9, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 21, 2019
preserve dtypes when applying a ufunc to a sparse dtype closes pandas-dev#18502 closes pandas-dev#23743
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 27, 2019
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 27, 2019
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 27, 2019
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 27, 2019
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 27, 2019
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jun 27, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Categorical
Categorical Data Type
Dtype Conversions
Unexpected or buggy dtype conversions
Enhancement
Groupby
Code Sample, a copy-pastable example if possible
Problem description
Grouping shouldn't coerce a categorical into object. Categorical dtypes should be preserved as long as possible for efficiency and correctness.
Expected Output
The result dtype should be CategoricalDtype(categories=['bar', 'foo', 'qux'], ordered=True), just like it is here:
The text was updated successfully, but these errors were encountered: