Skip to content

BUG: Preserve data order when stacking unsorted levels (#16323) #16325

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
May 11, 2017

Conversation

dsm054
Copy link
Contributor

@dsm054 dsm054 commented May 11, 2017

This should fix the df.stack() problems in #16323-- the levels being used to build the new index were those of the original frame, which fails when the levels get sorted.

@dsm054 dsm054 force-pushed the fix_stack_unsorted_levels branch from 5fcb44d to bd0eda2 Compare May 11, 2017 04:04
@codecov
Copy link

codecov bot commented May 11, 2017

Codecov Report

Merging #16325 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16325      +/-   ##
==========================================
- Coverage   90.37%   90.35%   -0.02%     
==========================================
  Files         161      161              
  Lines       50863    50863              
==========================================
- Hits        45966    45957       -9     
- Misses       4897     4906       +9
Flag Coverage Δ
#multiple 88.13% <100%> (ø) ⬆️
#single 40.33% <0%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/reshape/reshape.py 99.28% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.59% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0607e03...bd0eda2. Read the comment docs.

@codecov
Copy link

codecov bot commented May 11, 2017

Codecov Report

Merging #16325 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16325      +/-   ##
==========================================
- Coverage   90.37%   90.35%   -0.03%     
==========================================
  Files         161      161              
  Lines       50863    50863              
==========================================
- Hits        45966    45955      -11     
- Misses       4897     4908      +11
Flag Coverage Δ
#multiple 88.13% <100%> (-0.01%) ⬇️
#single 40.33% <0%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/reshape/reshape.py 99.28% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/common.py 90.68% <0%> (-0.35%) ⬇️
pandas/core/frame.py 97.59% <0%> (-0.1%) ⬇️
pandas/core/indexes/datetimes.py 95.23% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0607e03...bd0eda2. Read the comment docs.

@jreback jreback added MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels May 11, 2017
@jreback jreback added this to the 0.20.2 milestone May 11, 2017
@jreback jreback added the Regression Functionality that used to work in a prior pandas version label May 11, 2017
@jreback
Copy link
Contributor

jreback commented May 11, 2017

yep seems reasonable. this was an untested case.

@jreback jreback merged commit b1ff291 into pandas-dev:master May 11, 2017
TomAugspurger pushed a commit to TomAugspurger/pandas that referenced this pull request May 29, 2017
TomAugspurger pushed a commit that referenced this pull request May 30, 2017
stangirala pushed a commit to stangirala/pandas that referenced this pull request Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Regression Functionality that used to work in a prior pandas version Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

df.stack() behaving differently between 0.19.2 and 0.20.1
3 participants