text_plain_output_1.png
import pandas as pd

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

train_vals = pd.read_csv('../input/richters-predictor-modeling-earthquake-damage/train_values.csv')
train_labels = pd.read_csv('../input/richters-predictor-modeling-earthquake-damage/train_labels.csv')

train_vals.dtypes.value_counts()

train_df = train_vals.merge(train_labels, on='building_id')

corr = train_df.corr()['damage_grade'].sort_values(ascending=False)[1:]
corr = corr[abs(corr.values) > 0.01]

cats = []
for column in train_df.columns:
    if train_df[column].dtype == 'object':
        cats.append(column)
for cat in cats:
    train_df[cat] = train_df[cat].astype('category')
len(cats)