Sectie 1. Hoofdstuk 14
single
Challenge: Build a Simple Metrics Dashboard
Veeg om het menu te tonen
Taak
Veeg om te beginnen met coderen
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%
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 14
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.