Hi I was working thru your example and noticed here:
|
df['hourly_kids_median'] = df.groupby('hour')['descendants'].transform(median) |
Shouldn't this line
df.groupby('hour')['descendants'].transform(median)
be:
df.groupby('hour')['num_kids'].transform(median)
?