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
Explanation on mutate(ct=f.data2.transform(lambda x: nrow(x.iloc[0]))):
f.data2 is the column with the nested frames, and it is evaluated as a SeriesGroupBy object, since the entire frame is grouped
.transform() is to transform the nested frames into their corresponding # rows
lambda x: nrow(x.iloc[0])) is to get the # rows of the nested frames in each group in that f.data2 column. Note that x is a Series object with the nested frame as the only element. However, the index of the object is from 0 to 3 in each group, we can't use x[0] directly to get the element, instead, we need x.iloc[0].
Code -
Result -
Expected -
The text was updated successfully, but these errors were encountered: