text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder

import numpy as np # linear algebra

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

Health_df = pd.read_csv('../input/Big_Cities_Health_Data_Inventory.csv')

Health_df.apply(lambda x: len(x.unique()))

Health_df.isna().sum()

Health_df.dropna(subset=['Value'], inplace=True)

from sklearn.preprocessing import LabelEncoder
labelencoder = LabelEncoder()
cat_col = Health_df.select_dtypes(exclude=np.number).drop(['Notes', 'Methods'], axis=1)
num_col = Health_df.select_dtypes(include=np.number)

cat_col = cat_col.apply(LabelEncoder().fit_transform)

final_df = pd.concat([cat_col, num_col], axis=1)

final_df.head()