Created
July 5, 2017 14:17
-
-
Save dimuthnc/189678f059ded7b7513f8f074e6b942f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
train_features = pd.read_csv('Data/dengue_features_train.csv', | |
index_col=[0,1,2]) | |
train_labels = pd.read_csv('Data/dengue_labels_train.csv', | |
index_col=[0,1,2]) | |
# Seperate data for San Juan | |
sj_train_features = train_features.loc['sj'] | |
sj_train_labels = train_labels.loc['sj'] | |
# Separate data for Iquitos | |
iq_train_features = train_features.loc['iq'] | |
iq_train_labels = train_labels.loc['iq'] | |
# Remove `week_start_date` string. | |
sj_train_features.drop('week_start_date', axis=1, inplace=True) | |
iq_train_features.drop('week_start_date', axis=1, inplace=True) | |
sj_train_features.fillna(method='ffill', inplace=True) | |
iq_train_features.fillna(method='ffill', inplace=True) | |
sj_train_features['total_cases'] = sj_train_labels.total_cases | |
iq_train_features['total_cases'] = iq_train_labels.total_cases | |
sj_correlations = sj_train_features.corr() | |
iq_correlations = iq_train_features.corr() | |
(sj_correlations | |
.total_cases | |
.drop('total_cases') # don't compare with myself | |
.sort_values(ascending=False) | |
.plot | |
.barh()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment