Skip to content

BUG: groupby with dropna=False and pa.dictionary drops NA values #60567

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
rhshadrach opened this issue Dec 14, 2024 · 0 comments · Fixed by #60777
Closed

BUG: groupby with dropna=False and pa.dictionary drops NA values #60567

rhshadrach opened this issue Dec 14, 2024 · 0 comments · Fixed by #60777
Labels
Arrow pyarrow functionality Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments

@rhshadrach
Copy link
Member

df = pd.DataFrame({'A': ['a1', pd.NA]}, dtype=pd.ArrowDtype(pa.dictionary(pa.int32(), pa.utf8())))
print(df.groupby("A", dropna=False)[["A"]].first())
#      A
# A     
# a1  a1

There should be a 2nd row with the NA value since dropna=False.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant