It is common to use groupby to get the statistics of rows in the same group such as count, mean, median, etc. If you want to group rows into a list instead, use lambda x: list(x).
groupby
lambda x: list(x)
My previous tips on pandas.
DuckDB: Simplify DataFrame Analysis with Serverless SQL
Simplifying Dataset Comparison with Datacompy
Fuzzy Joining Tables with Non-Exact Matching Entries
Your email address will not be published. Required fields are marked *
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Δ