Seksjon 1. Kapittel 18
single
Challenge: Create a Sales Trend Chart
Sveip for å vise menyen
Oppgave
Sveip for å begynne å kode
Given a DataFrame containing sales data over time, create a function that generates a line chart of sales trends using matplotlib and saves the chart as a PNG file.
- Use the
date_colas the x-axis andsales_colas the y-axis in the line chart. - Set the chart title to the value of
title. - Label the x-axis as "Date" and the y-axis as "Sales".
- Add grid lines to the chart.
- Save the chart as a PNG image to the path specified by
output_path.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 18
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