Conteúdo do Curso
Analyzing and Visualizing Real-World Data
Analyzing and Visualizing Real-World Data
What 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.
# 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())
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-10 | Super Bowl |
2010-09-10, 2011-09-09, 2012-09-07 | Labor Day |
2010-11-26, 2011-11-25 | Thanksgiving |
2010-12-31, 2011-12-30 | Christmas |
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' |
Obrigado pelo seu feedback!