application_vnd.jupyter.stderr_output_1.png
import pandas as pd

Aquifer_Doganella = pd.read_csv('/kaggle/input/acea-water-prediction/Aquifer_Doganella.csv')
Aquifer_Auser = pd.read_csv('/kaggle/input/acea-water-prediction/Aquifer_Auser.csv')
Water_Spring_Amiata = pd.read_csv('/kaggle/input/acea-water-prediction/Water_Spring_Amiata.csv')
Lake_Bilancino = pd.read_csv('/kaggle/input/acea-water-prediction/Lake_Bilancino.csv')
Water_Spring_Madonna_di_Canneto = pd.read_csv('/kaggle/input/acea-water-prediction/Water_Spring_Madonna_di_Canneto.csv')
Aquifer_Luco = pd.read_csv('/kaggle/input/acea-water-prediction/Aquifer_Luco.csv')
Aquifer_Petrignano = pd.read_csv('/kaggle/input/acea-water-prediction/Aquifer_Petrignano.csv')
Water_Spring_Lupa = pd.read_csv('/kaggle/input/acea-water-prediction/Water_Spring_Lupa.csv')
River_Arno = pd.read_csv('/kaggle/input/acea-water-prediction/River_Arno.csv')
Aquifer_Doganella['Date'] = pd.to_datetime(Aquifer_Doganella['Date'])
Aquifer_Auser['Date'] = pd.to_datetime(Aquifer_Auser['Date'])
Water_Spring_Amiata['Date'] = pd.to_datetime(Water_Spring_Amiata['Date'])
Lake_Bilancino['Date'] = pd.to_datetime(Lake_Bilancino['Date'])
Water_Spring_Madonna_di_Canneto['Date'] = pd.to_datetime(Water_Spring_Madonna_di_Canneto['Date'])
Aquifer_Luco['Date'] = pd.to_datetime(Aquifer_Luco['Date'])
Aquifer_Petrignano['Date'] = pd.to_datetime(Aquifer_Petrignano['Date'])
Water_Spring_Lupa['Date'] = pd.to_datetime(Water_Spring_Lupa['Date'])
River_Arno['Date'] = pd.to_datetime(River_Arno['Date'])

def get_datefeatures(df):
    df['month'] = df.Date.dt.month
    df['day'] = df.Date.dt.day
    df['week'] = df.Date.dt.week
    df['year'] = df.Date.dt.year
    return df
Aquifer_Doganella = get_datefeatures(df=Aquifer_Doganella)
Aquifer_Auser = get_datefeatures(df=Aquifer_Auser)
Water_Spring_Amiata = get_datefeatures(df=Water_Spring_Amiata)
Lake_Bilancino = get_datefeatures(df=Lake_Bilancino)
Water_Spring_Madonna_di_Canneto = get_datefeatures(df=Water_Spring_Madonna_di_Canneto)
Aquifer_Luco = get_datefeatures(df=Aquifer_Luco)
Aquifer_Petrignano = get_datefeatures(df=Aquifer_Petrignano)
Water_Spring_Lupa = get_datefeatures(df=Water_Spring_Lupa)
River_Arno = Water_Spring_Lupa = get_datefeatures(df=River_Arno)

def check_duplicates(df, df_name):
    pass
check_duplicates(df=Aquifer_Doganella, df_name='Aquifer_Doganella')
check_duplicates(df=Aquifer_Auser, df_name='Aquifer_Auser')
check_duplicates(df=Water_Spring_Amiata, df_name='Water_Spring_Amiata')
check_duplicates(df=Lake_Bilancino, df_name='Lake_Bilancino')
check_duplicates(df=Water_Spring_Madonna_di_Canneto, df_name='Water_Spring_Madonna_di_Canneto')
check_duplicates(df=Aquifer_Luco, df_name='Aquifer_Luco')
check_duplicates(df=Aquifer_Petrignano, df_name='Aquifer_Petrignano')
check_duplicates(df=Water_Spring_Lupa, df_name='Water_Spring_Lupa')
check_duplicates(df=River_Arno, df_name='River_Arno')

def find_total_missing_days(df, df_name):
    daily_date = pd.date_range(start=df.Date.min(), end=df.Date.max(), freq='D')
    uniq_days = df.Date.nunique()
    print(f'#### {df_name}')
    print(f'Total unique days we have data: {uniq_days}')
    print(f'Total days missing: {len(daily_date) - uniq_days}')
    print('')
find_total_missing_days(df=Aquifer_Doganella, df_name='Aquifer_Doganella')
find_total_missing_days(df=Aquifer_Auser, df_name='Aquifer_Auser')
find_total_missing_days(df=Water_Spring_Amiata, df_name='Water_Spring_Amiata')
find_total_missing_days(df=Lake_Bilancino, df_name='Lake_Bilancino')
find_total_missing_days(df=Water_Spring_Madonna_di_Canneto, df_name='Water_Spring_Madonna_di_Canneto')
find_total_missing_days(df=Aquifer_Luco, df_name='Aquifer_Luco')
find_total_missing_days(df=Aquifer_Petrignano, df_name='Aquifer_Petrignano')
find_total_missing_days(df=Water_Spring_Lupa, df_name='Water_Spring_Lupa')
find_total_missing_days(df=River_Arno, df_name='River_Arno')