Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Plot Sales Moving Average | Automating Reports and Visual Insights
Python Automation for Reports and Visual Insights
Seção 1. Capítulo 22
single

single

bookChallenge: Plot Sales Moving Average

Deslize para mostrar o menu

Tarefa

Deslize para começar a programar

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 22
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt