Skip to content
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

BUG: do not fail when stack()ing unsortable level #18363

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

toobaz
Copy link
Member

@toobaz toobaz commented Nov 19, 2017

@codecov
Copy link

codecov bot commented Nov 19, 2017

Codecov Report

Merging #18363 into master will decrease coverage by 0.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18363      +/-   ##
==========================================
- Coverage   91.38%   91.36%   -0.03%     
==========================================
  Files         164      164              
  Lines       49790    49790              
==========================================
- Hits        45501    45490      -11     
- Misses       4289     4300      +11
Flag Coverage Δ
#multiple 89.16% <77.77%> (-0.01%) ⬇️
#single 39.53% <0%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/multi.py 96.21% <77.77%> (-0.17%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <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 f724066...c0a6136. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 19, 2017

Codecov Report

Merging #18363 into master will decrease coverage by 0.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18363      +/-   ##
==========================================
- Coverage   91.38%   91.36%   -0.03%     
==========================================
  Files         164      164              
  Lines       49790    49790              
==========================================
- Hits        45501    45490      -11     
- Misses       4289     4300      +11
Flag Coverage Δ
#multiple 89.16% <77.77%> (-0.01%) ⬇️
#single 39.53% <0%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/multi.py 96.21% <77.77%> (-0.17%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <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 f724066...c0a6136. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 19, 2017

Codecov Report

Merging #18363 into master will decrease coverage by 0.04%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18363      +/-   ##
==========================================
- Coverage   91.38%   91.33%   -0.05%     
==========================================
  Files         164      164              
  Lines       49790    49790              
==========================================
- Hits        45501    45478      -23     
- Misses       4289     4312      +23
Flag Coverage Δ
#multiple 89.14% <77.77%> (-0.03%) ⬇️
#single 39.53% <0%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/multi.py 96.21% <77.77%> (-0.17%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/plotting/_converter.py 63.44% <0%> (-1.82%) ⬇️
pandas/core/frame.py 97.8% <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 b00e62c...6d267a2. Read the comment docs.

def test_stack_mixed_level(self):
# GH 18310
levels = [range(3), [3, 'a'], [1, 2]]
# flat columns:
Copy link
Contributor

Choose a reason for hiding this comment

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

blank line here

# MultiIndex columns:
df = DataFrame(1, index=levels[0],
columns=MultiIndex.from_product(levels[1:]))
result = df.stack(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add the 2nd example you had in the issue as well, e.g. df[['a', 'b']].stack(0) (though different starting frame as well i think.

Copy link
Member Author

Choose a reason for hiding this comment

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

(done)
ping

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Nov 19, 2017
@toobaz
Copy link
Member Author

toobaz commented Dec 1, 2017

@jreback are you waiting for any action from me on this one?

@jreback jreback added this to the 0.22.0 milestone Dec 1, 2017
@jreback jreback merged commit f7df0ff into pandas-dev:master Dec 1, 2017
@jreback
Copy link
Contributor

jreback commented Dec 1, 2017

nope!

@toobaz toobaz deleted the stack_mixed_level branch December 1, 2017 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame.stack() raises TypeError on mixed type level under Python 3
2 participants