Seksjon 1. Kapittel 14
single
Challenge: Build a Simple Metrics Dashboard
Sveip for å vise menyen
Oppgave
Sveip for å begynne å kode
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 14
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår