-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
QST:TypeError: sum() got an unexpected keyword argument 'skipna' #35616
Comments
I just checked the >>> import pandas
>>> pandas.__version__
'1.1.0'
>>> help(pandas.core.groupby.generic.DataFrameGroupBy.sum) and got Help on function sum in module pandas.core.groupby.groupby:
sum(self, numeric_only: bool = True, min_count: int = 0)
Compute sum of group values.
Parameters
----------
numeric_only : bool, default True
Include only float, int, boolean columns. If None, will attempt to use
everything, then use only numeric data.
min_count : int, default 0
The required number of valid values to perform the operation. If fewer
than ``min_count`` non-NA values are present the result will be NA.
Returns
-------
Series or DataFrame
Computed sum of values within each group. Looks like Web docs reference - https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.sum.html |
Hmm interesting--thank you! Does anyone know why this was removed? It was functioning in previous versions perfectly |
That's weird. I don't know, it feels like the previous versions didn't have this. Could you tell which version you used that had this? So that it can be confirmed? Maybe the old docs just didn't reflect what was in the code |
Sorry for the delay-- it works perfectly on 0.25.3 |
Ah okay |
Thanks @zanwar369 for the question. I think is is covered by #29481, see #29481 (comment) for a workaround |
Is there an actual fix in the works? Confused as to why it was removed in the first place |
The underlying issue here is that the It might be that before this keyword was ignored and recently started to raise, but it never actually worked (or was never documented). The improvement to add |
Duplicate of #15675 |
Got the following error when trying to run a groupby sum after updating to the latest pandas:
TypeError: sum() got an unexpected keyword argument 'skipna'
->for row in Holdings[Holdings.Date>HP].groupby(['a','b','c']).sum(skipna=False)[['Balance','Withdrawal']:
....
The text was updated successfully, but these errors were encountered: