Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Build a Simple Metrics Dashboard | Automating Reports and Visual Insights
Python Automation for Reports and Visual Insights
Section 1. Chapter 14
single

single

bookChallenge: Build a Simple Metrics Dashboard

Swipe to show menu

Task

Swipe to start coding

Task: Business Metrics Dashboard

Create a function print_metrics_dashboard(df) that accepts a DataFrame with sales, conversions, and visits columns and prints a formatted summary of key business metrics.

  • Calculate total sales — the sum of the sales column
  • Calculate average order value — the mean of the sales column
  • Calculate conversion rate — the sum of conversions divided by the sum of visits, multiplied by 100

The printed output must include:

  • A header line: === Metrics Dashboard ===
  • Total sales formatted as: Total Sales: $X,XXX.XX
  • Average order value formatted as: Average Order Value: $X,XXX.XX
  • Conversion rate formatted as: Conversion Rate: XX.XX%

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 14
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt