Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
What Holidays are we Considering? | Analyzing Data
Analyzing and Visualizing Real-World Data
course content

Зміст курсу

Analyzing and Visualizing Real-World Data

Analyzing and Visualizing Real-World Data

1. Preprocessing Data: Part I
2. Preprocessing Data: Part II
3. Analyzing Data
4. Visualizing Data

bookWhat Holidays are we Considering?

Interesting! We can see that the median revenue for weeks with holidays is greater than for weeks without holidays. Let's find out which holidays are included in the dataset and summarize this information in a table.

123456789
# Loading the library import pandas as pd # Reading the data df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/72be5dde-f3e6-4c40-8881-e1d97ae31287/shops_data3.csv') df['Date'] = pd.to_datetime(df['Date'], dayfirst = True) # Filtering to only weeks with holiday print(df.loc[df['Holiday_Flag'] == 1]['Date'].unique())
copy

So, what holidays do we have? Let's summarize this information in the table.

Dates (in the dataframe)Holiday
2010-02-12, 2011-02-11, 2012-02-10Super Bowl
2010-09-10, 2011-09-09, 2012-09-07Labor Day
2010-11-26, 2011-11-25Thanksgiving
2010-12-31, 2011-12-30Christmas

Additionally, according to the result obtained in the previous chapter, we should include one week before Christmas, too.

Dates (in the dataframe)Holiday
2010-12-24, 2011-12-23'Pre-Christmas'

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 8
some-alt