SpinTheMic
Pro

Interview practice question

Preparing a pivot for a dashboard

Data Analyst · Python and Pandas · Intermediate

A dashboard needs a table with regions as rows, months as columns and total revenue, plus a total row and column. How do you create it in pandas?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • pivot_table index=region, columns=month, values=revenue, aggfunc=sum.
  • margins=True, margins_name="Total".
  • fill_value=0.
  • Order months chronologically.
  • Format and export.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics