Combination of groupby with dropna set to True and apply function not returning expected output #43205
Labels
Apply
Apply, Aggregate, Transform, Map
Bug
Groupby
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Regression
Functionality that used to work in a prior pandas version
Milestone
(Using pandas 1.3.1 and numpy 1.20.3)
This is a repetition of the SO question found here. (I did not have this issue previously when working with version 1.1.3).
In the following snippet:
I was expecting df and df_again to be identical. But they are not:
Now, if I tweak slightly the lambda expression slightly to "see" what is going on by
df.groupby("b", dropna=False).apply(lambda x: print(x))
I can actually visualize that also the portion of thedf
whereb
wasNaN
was processed.The text was updated successfully, but these errors were encountered: