<jupyter_start><jupyter_text>labels = test.pop('item_cnt_day')<jupyter_code>train.head()<jupyter_output><empty_output><jupyter_text>Let's find total sales per shop<jupyter_code>train_shop = train.copy()
train_shop.drop(['date', 'date_block_num', 'item_price', 'item_id'], axis=1, inplace=True)
train_shop.head()
train_shop = train_shop.groupby(['shop_id'], as_index=False).agg({'item_cnt_day':sum})
train_shop['shop_total_sales'] = train_shop.item_cnt_day
train_shop.drop('item_cnt_day', axis=1, inplace=True)
train_shop.head()
train_shop.plot(x='shop_id', y='shop_total_sales', kind='bar')
train = pd.merge(train, train_shop, left_on='shop_id', right_on='shop_id')
train.head()
train_items = train.copy()
train_items.drop(['date', 'date_block_num', 'shop_id', 'item_price', 'shop_total_sales'], axis=1, inplace=True)
train_items.head()
train_items = train_items.groupby(['item_id'], as_index=False).agg({'item_cnt_day':sum})
train_items['item_total_sales'] = train_items.item_cnt_day
train_items.drop('item_cnt_day', axis=1, inplace=True)
train_items.head()
train_items.describe()
train = pd.merge(train, train_items, left_on='item_id', right_on='item_id')
train.head(10)<jupyter_output><empty_output><jupyter_text>Let's find sales per season.- Fall: months 09, 10, 11- Winter: months 12, 01, 02- Spring: months 03, 04, 05- Summer: months 06, 07, 08<jupyter_code>train['month'] = train.date_block_num % 12 + 1
train.head(10)
def season(x):
    if x in [9, 10, 11]:
        return 1 # Fall
    if x in [12, 1, 2]:
        return 2 # Winter
    if x in [3, 4, 5]:
        return 3 # Spring
    if x in [6, 7, 8]:
        return 4 # Summer
train['season'] = train.month.apply(season)
train.head(10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1633835457705678, 'fraction_numerical': 0.03244495944380069, 'mean_word_length': 6.607929515418502, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '35940', 'license': 'MIT', 'n_tokens_mistral': 705, 'n_tokens_neox': 650, 'n_words': 128, 'path': 'script/EDA_2.0.ipynb', 'repo_name': 'maviator/kaggle_coursera_course', 'size': '1726'}