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

TST: Add test of DataFrame.xs() with duplicates (#13719) #22294

Merged
merged 3 commits into from
Sep 15, 2018

Conversation

nmusolino
Copy link
Contributor

Added tests of DataFrame.xs() method for multilevel index containing duplicates. The underlying bug reported in #13719 was fixed previously, but was not covered by specific unit tests.

@pep8speaks
Copy link

pep8speaks commented Aug 12, 2018

Hello @nmusolino! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on August 16, 2018 at 01:14 Hours UTC

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite MultiIndex labels Aug 13, 2018
@@ -486,6 +486,13 @@ def test_xs_partial(self):
expected = df.loc['foo', 'one']
tm.assert_frame_equal(result, expected)

# DataFrame with a MultiIndex containing duplicates (#13719)
Copy link
Contributor

@jreback jreback Aug 13, 2018

Choose a reason for hiding this comment

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

pls add as a separate test.

@codecov
Copy link

codecov bot commented Aug 16, 2018

Codecov Report

Merging #22294 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22294      +/-   ##
==========================================
- Coverage   92.08%   92.05%   -0.04%     
==========================================
  Files         169      169              
  Lines       50694    50709      +15     
==========================================
- Hits        46682    46678       -4     
- Misses       4012     4031      +19
Flag Coverage Δ
#multiple 90.45% <ø> (-0.04%) ⬇️
#single 42.25% <ø> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/util/_depr_module.py 65.11% <0%> (-2.33%) ⬇️
pandas/core/internals/blocks.py 93.83% <0%> (-0.81%) ⬇️
pandas/core/dtypes/missing.py 92.98% <0%> (-0.59%) ⬇️
pandas/core/series.py 93.72% <0%> (-0.4%) ⬇️
pandas/util/testing.py 85.85% <0%> (-0.05%) ⬇️
pandas/core/generic.py 96.44% <0%> (-0.04%) ⬇️
pandas/core/frame.py 97.24% <0%> (-0.01%) ⬇️
pandas/plotting/_core.py 83.48% <0%> (ø) ⬆️
pandas/core/indexes/multi.py 95.41% <0%> (+0.07%) ⬆️
pandas/core/ops.py 96.71% <0%> (+0.14%) ⬆️

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 d09db1f...ee88689. Read the comment docs.

@nmusolino
Copy link
Contributor Author

@jreback This is ready for another look.

@jreback jreback added this to the 0.24.0 milestone Sep 15, 2018
@jreback jreback merged commit 3745576 into pandas-dev:master Sep 15, 2018
@jreback
Copy link
Contributor

jreback commented Sep 15, 2018

thanks @nmusolino

@nmusolino nmusolino deleted the add-xs-test branch September 15, 2018 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame.xs() throws value error with non-unique multi index if level kwarg is called.
4 participants