Pandas pivot_table Silently Aggregating Wrong Columns: How to Fix It
If your Pandas pivot_table is producing numbers that don't match your expectations, the aggregation is probably running on the wrong columns. Here's how to catch it, understand why it happens, and fix it for good.