# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import pandas as pd
import matplotlib.pyplot as plt
# %matplotlib inline
import numpy as np
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')

ori=pd.read_csv('website_data_20190225.csv')
ori.drop(['STATE','DISTRICT','WLCODE','SITE_TYPE','TEH_NAME'],axis=1,inplace=True)
ori.replace(to_replace="'0",value=0,inplace=True)
ori.head()

# +
dup_df=pd.DataFrame().reindex_like(ori)
dup_df.dropna(inplace=True)

# j=0
# for i in range(0,ori.shape[0]):
#     if ori['STATE'][i]=='RJ':
#         dup_df.loc[j] = ori.iloc[i]
#         j+=1
# dup_df.drop(['STATE'],axis=1,inplace=True)

# j=0
# for i in range(0,ori.shape[0]):
#     if ori['DISTRICT'][i]=='Ajmer':
#         dup_df.loc[j] = ori.iloc[i]
#         j+=1
# dup_df.drop(['DISTRICT'],axis=1,inplace=True)

j=0
for i in range(0,ori.shape[0]):
    if ori['BLOCK_NAME'][i]=='Arain':
        dup_df.loc[j] = ori.iloc[i]
        j+=1
dup_df.drop(['BLOCK_NAME'],axis=1,inplace=True)

j=0
for i in range(0,ori.shape[0]):
    if ori['SITE_NAME'][i]=='Sanpla':
        dup_df.loc[j] = ori.iloc[i]
        j+=1
dup_df.drop(['SITE_NAME'],axis=1,inplace=True)
        
dup_df.head()
# -

for i in range(0,dup_df.shape[0]):
    dup_df['MONSOON'][i]=float(dup_df['MONSOON'][i])
    dup_df['POMRB'][i]=float(dup_df['POMRB'][i])
    dup_df['POMKH'][i]=float(dup_df['POMKH'][i])
    dup_df['PREMON'][i]=float(dup_df['PREMON'][i])
    dup_df['YEAR_OBS'][i]=int(dup_df['YEAR_OBS'][i])

first=list(dup_df['MONSOON'])
second=list(dup_df['POMRB'])
third=list(dup_df['POMKH'])
fourth=list(dup_df['PREMON'])
dup_df['MONSOON']=pd.core.frame.DataFrame(x+y+z+w for x, y,z,w in zip(first, second, third, fourth))
dup_df.drop(['POMRB','POMKH','PREMON'],axis=1,inplace=True)
dup_df.head()

StarcoderdataJupyterScriptsDedupFiltered