image_output_11.png image_output_14.png image_output_13.png image_output_5.png image_output_7.png image_output_4.png image_output_8.png image_output_6.png image_output_12.png image_output_3.png image_output_2.png image_output_1.png image_output_10.png image_output_9.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

train = pd.read_csv('../input/30-days-of-ml/train.csv', index_col=0)
test = pd.read_csv('../input/30-days-of-ml/test.csv', index_col=0)

train.shape

train.dtypes.value_counts()

y = train['target']
features = train.drop(['target'], axis=1)

object_cols = [col for col in features.columns if 'cat' in col]

y.dtype

for col in features.select_dtypes('object'):
    plt.figure()
    x = features[col].value_counts()
    features[col].value_counts().plot.pie(autopct=lambda x: str(round(x, 2)) + '%', pctdistance=2, labeldistance=1.4, shadow=True)