Skip to content

DOC: Update whatsnew for crosstab fix #43548

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

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

bashtage
Copy link
Contributor

xref #43505

  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

@@ -433,7 +433,7 @@ Reshaping
- Bug in :meth:`pandas.cut` on :class:`Series` with duplicate indices (:issue:`42185`) and non-exact :meth:`pandas.CategoricalIndex` (:issue:`42425`)
- Bug in :meth:`DataFrame.append` failing to retain dtypes when appended columns do not match (:issue:`43392`)
- Bug in :func:`concat` of ``bool`` and ``boolean`` dtypes resulting in ``object`` dtype instead of ``boolean`` dtype (:issue:`42800`)
-
- Bug in :func:`crosstab` when inputs are are categorical Series, there are categories that are not present in one or both of the Series, and ``margins=True``. Previously the margin value for missing categories was ``NaN``. It is now correctly reported as 0 (:issue:`43505`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason is that min_count=0 in .sum is implicitly passed thru (somewhere)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be a reindex. It only happens for categoricals since when there are missing categories the crosstab knows there are 0 of any category in the categorical that has no corresponding values in the data. Do you think it is worth more explanation?

@jreback jreback added this to the 1.4 milestone Sep 13, 2021
@jreback jreback added Docs Groupby Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Sep 13, 2021
@jreback jreback merged commit b1e38eb into pandas-dev:master Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Groupby Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants