Секція 1. Розділ 22
single
Challenge: Plot Sales Moving Average
Свайпніть щоб показати меню
Завдання
Проведіть, щоб почати кодувати
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.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 22
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат