2 Comments

In my biased opinion as someone who never learned pivot_table, one should stick to groupby, at least in the workplace. First, even if one understands pivot_table, one might have coworkers (like me) who don't, and will have difficulty working with the code later. Second, groupby's implementation is more optimized for efficiency. This StackOverflow answer is illustrative: https://stackoverflow.com/a/74048672 . The speedup from using groupby can be multiple orders of magnitude!

Expand full comment

Thanks, Calvin!

Expand full comment