We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using the official documentation for groupby: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html
the dropna=False argument does not work even with given example.
l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]] df = pd.DataFrame(l, columns=["a", "b", "c"]) df.groupby(by=["b"], dropna=False).sum()
The text was updated successfully, but these errors were encountered:
This runs on master:
In [2]: l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]] ...: df = pd.DataFrame(l, columns=["a", "b", "c"]) ...: df.groupby(by=["b"], dropna=False).sum() Out[2]: a c b 1.0 2 3 2.0 2 5 NaN 1 4
It was fixed in #35078
Sorry, something went wrong.
Thanks for reporting this, the fix will be available when 1.2 is released.
Any workarounds while I wait for 1.2?
in case that helps 1.2 is out within a few weeks (and actually the release candidate is out already if you feel like trying it out)
For a workaround, can replace nan with a value that doesn't exist in the frame, do the groupby, and then refill will nan.
The issue still persists. "TypeError: group() got an unexpected keyword argument 'dropna'"
No branches or pull requests
Using the official documentation for groupby: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html
the dropna=False argument does not work even with given example.
l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]
df = pd.DataFrame(l, columns=["a", "b", "c"])
df.groupby(by=["b"], dropna=False).sum()
The text was updated successfully, but these errors were encountered: