Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Compare Regional Performance | Automating Reports and Visual Insights
Python Automation for Reports and Visual Insights
Sectie 1. Hoofdstuk 16
single

single

bookChallenge: Compare Regional Performance

Veeg om het menu te tonen

Taak

Veeg om te beginnen met coderen

Create a function compare_regional_performance() that builds a regional sales DataFrame, computes key metrics, and prints a formatted summary.

  • Create a DataFrame with columns "Region" and "Sales" containing at least four regions and their sales values
  • Calculate total sales — the sum of the Sales column
  • Identify the region with the highest sales and its value
  • Identify the region with the lowest sales and its value
  • Print a summary that includes:
    • A header: Regional Sales Summary:
    • Total sales as: Total Sales: {value}
    • Highest performing region as: Highest Sales: {region} ({value})
    • Lowest performing region as: Lowest Sales: {region} ({value})
    • A label All Regions: followed by a table of all regions and their sales

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 16
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt