text_plain_output_1.png
from sklearn.model_selection import train_test_split

import numpy as np # linear algebra

import numpy as np # linear algebra

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

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

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

df.columns

cols_to_Encode = ['Gender', 'Race/ Ethnicity', 'Indicator Category']
continuous_cols = ['Value']

encoded_cols = pd.get_dummies(df[cols_to_Encode])

df_final = pd.concat([encoded_cols, df[continuous_cols]], axis=1)

y = df_final['Value']
x = df_final.drop(columns='Value')

df_final.shape

train_X, test_X, train_Y, test_Y = train_test_split(x, y, test_size=0.3)
df_final.columns.dtype

df_column_category = df_final.select_dtypes(exclude=np.number).columns
df_column_category