Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Create a Sales Trend Chart | Automating Reports and Visual Insights
Python Automation for Reports and Visual Insights
Avsnitt 1. Kapitel 18
single

single

bookChallenge: Create a Sales Trend Chart

Svep för att visa menyn

Uppgift

Svep för att börja koda

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_col as the x-axis and sales_col as 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

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 18
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

some-alt