An analyst is using Python pandas and has a DataFrame 'sales' with columns 'date', 'product', 'revenue'. They need to create a pivot table showing total revenue per product per month. Which pandas function is most appropriate?
pivot_table creates a matrix with products as rows and months as columns.
Why this answer
pivot_table is specifically designed to reshape data and aggregate values based on index and columns.