Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Plot Sales Moving Average | Automating Reports and Visual Insights
Python Automation for Reports and Visual Insights
Abschnitt 1. Kapitel 22
single

single

bookChallenge: Plot Sales Moving Average

Swipe um das Menü anzuzeigen

Aufgabe

Wischen, um mit dem Codieren zu beginnen

Given a DataFrame containing columns for 'date' and 'sales', your task is to plot the original sales data and a 7-day moving average trend line on the same chart using matplotlib.

  • Calculate the 7-day moving average of the 'sales' column and store it as a new column in the DataFrame.
  • Plot the original sales values against their corresponding dates.
  • Plot the 7-day moving average values on the same chart.
  • Add axis labels and a title to the chart.
  • Add a legend to distinguish between the original sales and the moving average.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 22
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt