Sektion 1. Kapitel 14
single
Challenge: Build a Simple Metrics Dashboard
Stryg for at vise menuen
Opgave
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
salescolumn - Calculate average order value — the mean of the
salescolumn - Calculate conversion rate — the sum of
conversionsdivided by the sum ofvisits, 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%
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 14
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat