r-brink / baby_names_generator

6 stars 0 forks source link

Consider `keep_name` expression #2

Open ritchie46 opened 3 years ago

ritchie46 commented 3 years ago

https://github.com/r-brink/baby_names_generator/blob/bd9777fcffc375b2e27d840bd87c8044228a58c1/generate_babynames_complete.ipynb#L262

Using this expr makes sure that the column names are restored during an aggregation.

df_nl = df_stacked.groupby('Naam').agg([pl.sum('Aantal').keep_name()])
r-brink commented 3 years ago

Thanks, didn't know it existed. Gonna update it