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
.
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
.