Skip to content

Crosstab Preserves Dtypes release note #24789

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
TomAugspurger opened this issue Jan 15, 2019 · 2 comments
Closed

Crosstab Preserves Dtypes release note #24789

TomAugspurger opened this issue Jan 15, 2019 · 2 comments
Labels
Milestone

Comments

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Jan 15, 2019

The note at http://pandas.pydata.org/pandas-docs/version/0.24.0rc1/whatsnew/v0.24.0.html#crosstab-preserves-dtypes seems incorrect (it's a code block instead of an ipython block, but after making that change and running it).

On master, I get the same output as 0.23.4

0.23.4

In [1]: import pandas as pd; import numpy as np

In [2]: df = pd.DataFrame({'a': [1, 2, 2, 2, 2],
   ...:                    'b': [3, 3, 4, 4, 4],
   ...:                    'c': [1, 1, np.nan, 1, 1]})
   ...:
   ...: pd.crosstab(df.a, df.b, normalize='columns')
   ...:
Out[2]:
b    3    4
a
1  0.5  0.0
2  0.5  1.0

master

In [98]: df = pd.DataFrame({'a': [1, 2, 2, 2, 2],
   ....:                    'b': [3, 3, 4, 4, 4],
   ....:                    'c': [1, 1, np.nan, 1, 1]})
   ....:

In [99]: pd.crosstab(df.a, df.b, normalize='columns')
## -- End pasted text --
Out[4]:
b    3    4
a
1  0.5  0.0
2  0.5  1.0

@jbrockmendel this came from #22019. Do you know if the note is obsolete, or has there been a regression?

@TomAugspurger TomAugspurger added this to the 0.24.0 milestone Jan 15, 2019
@jbrockmendel
Copy link
Member

this came from #22019. Do you know if the note is obsolete, or has there been a regression?

I'm not aware of an intentional change making it obsolete, so I guess it counts as a regression. That said, the behavior change in this note was a side-effect of #22019, not at all part of the intention. It looks like the edits that #22019 made in tests.frame.test_axis_select_reindex and tests.reshape.test_pivot are no longer necessary. I'd say revert those, remove the note, and call it a win.

@TomAugspurger
Copy link
Contributor Author

TomAugspurger commented Jan 16, 2019

I'd say revert those, remove the note, and call it a win.

agreed. I'll put up a PR quick.

TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Jan 16, 2019
At the time, pandas-dev#22019 seemed to
break API in a few places. Since then, those API breaking changes have
disappeared, so the changes to the tests and the release note are no
longer necessary.

Closes pandas-dev#24789
TomAugspurger added a commit that referenced this issue Jan 16, 2019
At the time, #22019 seemed to
break API in a few places. Since then, those API breaking changes have
disappeared, so the changes to the tests and the release note are no
longer necessary.

Closes #24789
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this issue Feb 28, 2019
At the time, pandas-dev#22019 seemed to
break API in a few places. Since then, those API breaking changes have
disappeared, so the changes to the tests and the release note are no
longer necessary.

Closes pandas-dev#24789
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this issue Feb 28, 2019
At the time, pandas-dev#22019 seemed to
break API in a few places. Since then, those API breaking changes have
disappeared, so the changes to the tests and the release note are no
longer necessary.

Closes pandas-dev#24789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants