text_html_output_1.png
from datetime import datetime, date

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

Aquifer_Petrignano_input = pd.read_csv('../input/acea-water-prediction/Aquifer_Petrignano.csv')
Lake_Bilancino_input = pd.read_csv('../input/acea-water-prediction/Lake_Bilancino.csv')

Aquifer_Petrignano = Aquifer_Petrignano_input.copy()
Lake_Bilancino = Lake_Bilancino_input.copy()

Aquifer_Petrignano['Date'] = pd.to_datetime(Aquifer_Petrignano['Date'], format='%d/%m/%Y')
Lake_Bilancino['Date'] = pd.to_datetime(Lake_Bilancino['Date'], format='%d/%m/%Y')

def fillna_from_list(column, list_):
    """Function get column and list for replace missing values"""
    list_for_df = []
    i = -1
    for el in column:
        if el == -1000000:
            i += 1
            list_for_df.append(list_.iloc[i + 1])
        else:
            list_for_df.append(el)
    return list_for_df

pd.concat([pd.Series(Aquifer_Petrignano.isnull().sum()).rename_axis('Aquifer_Petrignano_features/target').to_frame('Missing Value Count').reset_index(), pd.Series(Lake_Bilancino.isnull().sum()).rename_axis('Lake_Bilancino_features/target').to_frame('Missing Value Count').reset_index()], axis=1)

Aquifer_Petrignano.dropna(subset=['Depth_to_Groundwater_P25'], inplace=True)
Lake_Bilancino.dropna(subset=['Flow_Rate'], inplace=True)

f, ax = plt.subplots(nrows=7, ncols=1, figsize=(20, 50))
for i, column in enumerate(Aquifer_Petrignano.drop('Date', axis=1).columns):
    sns.lineplot(x=Aquifer_Petrignano['Date'], y=Aquifer_Petrignano[column], ax=ax[i], color='dodgerblue')
    ax[i].set_title('Feature: {}'.format(column), fontsize=14)
    ax[i].set_ylabel(ylabel=column, fontsize=14)
    ax[i].set_xlim([date(2006, 1, 1), date(2020, 6, 30)])