text_plain_output_1.png image_output_1.png
from plotly.offline import init_notebook_mode, iplot

import matplotlib.pyplot as plt  # Matlab-style plotting

import os

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

import seaborn as sns

import warnings

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
import seaborn as sns
color = sns.color_palette()
sns.set_style('darkgrid')
import warnings
def ignore_warn(*args, **kwargs):
    pass
warnings.warn = ignore_warn
from scipy import stats
from scipy.stats import norm, skew
pd.set_option('display.float_format', lambda x: '{:.3f}'.format(x))
import os

train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')

train_ID = train['id']
test_ID = test['id']
train.drop('id', axis=1, inplace=True)
test.drop('id', axis=1, inplace=True)

corrmat = train.corr()

missing = train.isnull().sum()

train_dummy = pd.get_dummies(pd.read_csv('../input/train.csv'))

ghost_num = {'type': {'Ghoul': 1, 'Goblin': 2, 'Ghost': 3}}

train.replace(ghost_num, inplace=True)

ntrain = train.shape[0]
ntest = test.shape[0]
y = train.type.values
all_data = pd.concat((train, test)).reset_index(drop=True)
all_data.drop(['type'], axis=1, inplace=True)

all_data.drop(['color'], axis=1, inplace=True)

all_data_simple = pd.DataFrame()
all_data_simple['bone_hair'] = all_data['bone_hair']
all_data_simple['rotting_flesh'] = all_data['rotting_flesh']
all_data_simple['bone_soul'] = all_data['bone_soul']
all_data_simple['hair_soul'] = all_data['hair_soul']

all_data_simple.head()