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
apply can act as a reducer, transformer, or filter function, depending on exactly what is passed to apply. So depending on the path taken, and exactly what you are grouping. Thus the grouped columns(s) may be included in the output as well as set the indices.
So, I think it may discard the group if the callback function returns None. Here is two exmaple that works and not works:
yeah that prob should look at the non-Nones to infer what is going on. This is done in the other _wrap_applied_output for NDFrame so you can copy the same pattern.
The apply document says that it can:
So, I think it may discard the group if the callback function returns None. Here is two exmaple that works and not works:
the output is as following, the first one returns a DataFrame, the second one returns a Series with DataFrames inside:
The problem is that
_wrap_applied_output()
ingroupby.py
checks the first element to determine the concat method:I want to know, does
groupby().apply()
support discarding groups?The text was updated successfully, but these errors were encountered: