Skip to content

TST: Groupby.filter dropna=False with empty group (#10780) #14926

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
Dec 20, 2016

Conversation

mroeschke
Copy link
Member

Didn't find a PR in 0.20 or 0.19.2 that closed this, but works on master 0.19.1

@jreback jreback added Bug Groupby Testing pandas testing functions or related to the test suite labels Dec 20, 2016
@jreback jreback added this to the 0.20.0 milestone Dec 20, 2016
# GH 10780
data = pd.Series(np.random.rand(9), index=np.repeat([1, 2, 3], 3))
groupped = data.groupby(level=0)
result = groupped.filter(lambda x: x.mean() > 1, dropna=False)
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 testing for dropna=True as well, for completeness

@codecov-io
Copy link

codecov-io commented Dec 20, 2016

Current coverage is 84.65% (diff: 100%)

Merging #14926 into master will increase coverage by <.01%

@@             master     #14926   diff @@
==========================================
  Files           144        144          
  Lines         51023      51023          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43190      43191     +1   
+ Misses         7833       7832     -1   
  Partials          0          0          

Powered by Codecov. Last update 3ab0e55...ee4ce0f

@mroeschke
Copy link
Member Author

Added test for dropna=True and all green.

@jreback jreback merged commit 3ab369c into pandas-dev:master Dec 20, 2016
@jreback
Copy link
Contributor

jreback commented Dec 20, 2016

thanks!

@mroeschke mroeschke deleted the test_10780 branch December 21, 2016 04:23
ShaharBental pushed a commit to ShaharBental/pandas that referenced this pull request Dec 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

grouped.filter with dropna option
3 participants