You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A resample apply accessing a column of the subsetted dataframe fails (bubbling up the error from first trying the function on a single column, i.e. a Series):
In [25]: df = pd.DataFrame({"col": range(10)}, index=pd.date_range("2012-01-01", periods=10, freq="20min"))
In [26]: df.resample("H").apply(lambda group: len(group['col'].unique()))
...
KeyError: 'col'
In [27]: df.resample("H").apply(lambda group: len(group.col.unique()))
...
AttributeError: 'Series' object has no attribute 'col'
This seems a regression, or was there a deliberate change in apply to only apply it on the columns and no longer on the full DataFrame ?
cc @jbrockmendel