Skip to content

BUG: Resolving fallback from skipna flag in groupby().sum() #26179

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

Closed

Conversation

mukundm19
Copy link

@mukundm19 mukundm19 commented Apr 21, 2019

Issue #20824 found that a fallback was occuring when df.Groupby().sum() was called with the skipna flag. This was occurring because the _cython_agg_general function was not accepting the argument, which has now been fixed. The fallback still occurs with strings in the df, however this is a deeper issue stemming from the _aggregate() call in groupby/ops.py (line 572).

@codecov
Copy link

codecov bot commented Apr 21, 2019

Codecov Report

Merging #26179 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26179      +/-   ##
==========================================
- Coverage   91.98%   91.98%   -0.01%     
==========================================
  Files         175      175              
  Lines       52371    52371              
==========================================
- Hits        48175    48171       -4     
- Misses       4196     4200       +4
Flag Coverage Δ
#multiple 90.53% <ø> (ø) ⬆️
#single 40.71% <ø> (-0.15%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby/generic.py 89.02% <ø> (ø) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.9% <0%> (-0.12%) ⬇️

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 bbcfc7f...0a76132. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 21, 2019

Codecov Report

Merging #26179 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26179      +/-   ##
==========================================
- Coverage   91.98%   91.98%   -0.01%     
==========================================
  Files         175      175              
  Lines       52371    52371              
==========================================
- Hits        48175    48171       -4     
- Misses       4196     4200       +4
Flag Coverage Δ
#multiple 90.53% <ø> (ø) ⬆️
#single 40.71% <ø> (-0.15%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby/generic.py 89.02% <ø> (ø) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.9% <0%> (-0.12%) ⬇️

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 bbcfc7f...e8c93fb. Read the comment docs.

Removing whatsnew entry; not user facing.
Removing text unintentionally added while resolving conflict
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Please add a test - should be the first part of any PR

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.

needs a tests & whastnew

@jreback
Copy link
Contributor

jreback commented May 7, 2019

needs test; ping if you want to continue working.

@jreback jreback closed this May 7, 2019
@sireesha-m
Copy link

Hi folks,
How can one resolve this issue? I am using pandas 1.0.3 and experiencing the same issue, "skipna" is not being accepted by sum() function. The call below is failing with a similar error

cnt = df.groupby(groupby_cols).sum(skipna=False)[prop_cols]

_cython_agg_general() got an unexpected keyword argument 'skipna'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame.groupby().sum() treating Nan as 0.0
5 participants