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

single

bookChallenge: Compare Regional Performance

Scorri per mostrare il menu

Compito

Scorri per iniziare a programmare

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

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 16
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt