text_html_output_1.png
import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('../input/tabular-playground-series-sep-2022/train.csv')

test = pd.read_csv('../input/tabular-playground-series-sep-2022/test.csv')

df_total = train.append(test)

df_total.drop('row_id', axis=1, inplace=True)

df_total['date'] = pd.to_datetime(df_total['date'], format='%Y-%m-%d')
df_total['year'] = df_total['date'].dt.year
df_total['month'] = df_total['date'].dt.month
df_total['day'] = df_total['date'].dt.day
df_total['day_of_week'] = df_total['date'].dt.day_of_week
df_total['day_of_year'] = df_total['date'].dt.day_of_year
df_total['is_weekend'] = np.where(df_total['day_of_week'].isin([5, 6]), 1, 0)
df_total.drop('date', axis=1, inplace=True)

df_total['country'].value_counts()