I\'m curious about the behavior of pandas groupby-apply when the apply function returns a series.
When the series are of different lengths, it returns a multi-indexed se
instead of doing index=range(len(x)) in your function f, you can do index=x.index to prevent this undesired behavior
index=range(len(x))
index=x.index