Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
YStrano
GitHub Repository: YStrano/DataScience_GA
Path: blob/master/lessons/lesson_16/05_independent_practice.ipynb
1904 views
Kernel: Python 3

Time Series: Independent Practice

import pandas as pd import numpy as np %matplotlib inline

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 a datetime object.

  • Set Date as the index of the DataFrame.

walmart = pd.read_csv('data/train.csv')
walmart.head()

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.

4) Compute the 1, 13, and 52 autocorrelations for Weekly_Sales and/or create an autocorrelation plot.

5) Create a decomposition plot for the Store 1 sales data.

6) Based on the analyses above, what can we deduce about this time series?