Path: blob/master/lessons/lesson_16/05_independent_practice.ipynb
1904 views
Kernel: Python 3
Time Series: Independent Practice
In [3]:
Walmart Sales Data
For this independent practice, we'll analyze Walmart's weekly sales data over a two-year period from 2010 to 2012.
The data set is again separated by store and department, but we'll focus on analyzing one store for simplicity.
The data include:
Store
: The store number.Dept
: The department number.Date
: The week.Weekly_Sales
: Sales for the given department in the given store.IsHoliday
: Whether the week is a special holiday week.
1) Preprocess the data using Pandas.
Load the data.
Convert the
Date
column to adatetime
object.Set
Date
as the index of the DataFrame.
In [6]:
In [7]:
Out[7]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
2) Filter the DataFrame to Store 1 sales and aggregate over departments to compute the total weekly sales per store. Store this in a new DataFrame.
In [ ]:
In [ ]:
3) Plot the rolling mean for Weekly_Sales
. What general trends do you observe?
In [ ]:
4) Compute the 1
, 13
, and 52
autocorrelations for Weekly_Sales
and/or create an autocorrelation plot.
In [ ]:
In [ ]:
In [ ]:
5) Create a decomposition plot for the Store 1 sales data.
In [ ]:
In [ ]:
6) Based on the analyses above, what can we deduce about this time series?
In [ ]:
In [ ]: