Skip to content

Error with .drop([]) on non-unique index #16428

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 4 commits into from
May 24, 2017

Conversation

lkirk
Copy link
Contributor

@lkirk lkirk commented May 22, 2017

Wraps the labels array in _ensure_object. The labels array is being cast to a float by default, causing the error raised in #16398.

@lkirk
Copy link
Contributor Author

lkirk commented May 22, 2017

Where does the whatsnew entry go for this PR?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented May 22, 2017

This can be 0.20.2 since it's a bugfix

@TomAugspurger TomAugspurger added Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels May 22, 2017
@TomAugspurger TomAugspurger added this to the 0.20.2 milestone May 22, 2017
@lkirk
Copy link
Contributor Author

lkirk commented May 22, 2017

Done, plz let me know if you need anything else on my end

@@ -93,3 +93,5 @@ Categorical

Other
^^^^^

- Fix ``pd.drop([])`` for dataframes with non-unique indices (:issue:`16270`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug in df.drop([]) for DataFrame with non-unique indices

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

pls add the test from the issue.

@TomAugspurger
Copy link
Contributor

@lloydkirk can you update with a test and fix the note in the whatsnew? The test can go in pandas/tests/frame/test_axis_select_reindex.py

@codecov
Copy link

codecov bot commented May 23, 2017

Codecov Report

Merging #16428 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16428      +/-   ##
==========================================
- Coverage   90.42%   90.42%   -0.01%     
==========================================
  Files         161      161              
  Lines       51023    51023              
==========================================
- Hits        46138    46137       -1     
- Misses       4885     4886       +1
Flag Coverage Δ
#multiple 88.26% <100%> (-0.01%) ⬇️
#single 40.17% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/generic.py 92.13% <100%> (ø) ⬆️
pandas/core/common.py 91.05% <0%> (-0.34%) ⬇️

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 49ec31b...1973925. Read the comment docs.

@codecov
Copy link

codecov bot commented May 23, 2017

Codecov Report

Merging #16428 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16428      +/-   ##
==========================================
- Coverage   90.42%   90.42%   -0.01%     
==========================================
  Files         161      161              
  Lines       51023    51023              
==========================================
- Hits        46138    46137       -1     
- Misses       4885     4886       +1
Flag Coverage Δ
#multiple 88.26% <100%> (-0.01%) ⬇️
#single 40.17% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/generic.py 92.13% <100%> (ø) ⬆️
pandas/core/common.py 91.05% <0%> (-0.34%) ⬇️

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 49ec31b...1973925. Read the comment docs.

@lkirk
Copy link
Contributor Author

lkirk commented May 23, 2017

Done, added a test to test_drop, and to test_drop_names, and fixed the whatsnew language

@jreback jreback merged commit b0a51df into pandas-dev:master May 24, 2017
@jreback
Copy link
Contributor

jreback commented May 24, 2017

thanks!

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
Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with .drop([]) on non-unique index
3 participants