text_plain_output_1.png
import pandas as pd

people = pd.read_csv('../input/people.csv')
activity_train = pd.read_csv('../input/act_train.csv')
activity_test = pd.read_csv('../input/act_test.csv')

df = activity_train.merge(people, how='left', on='people_id')
df_test = activity_test.merge(people, how='left', on='people_id')

df = df.fillna('0', axis=0)
df_test = df_test.fillna('0', axis=0)

def processor(data):
    data = MultiColumnLabelEncoder(columns=['people_id', 'activity_id', 'activity_category', 'date_x', 'char_1_x', 'char_2_x', 'char_3_x', 'char_4_x', 'char_5_x', 'char_6_x', 'char_7_x', 'char_8_x', 'char_9_x', 'char_10_x', 'char_1_y', 'group_1', 'char_2_y', 'date_y', 'char_3_y', 'char_4_y', 'char_5_y', 'char_6_y', 'char_7_y', 'char_8_y', 'char_9_y']).fit_transform(df)
    bool_map = {True: 1, False: 0}
    data = data.applymap(lambda x: bool_map.get(x, x))
    return data

df_encoded = processor(df)

df_encoded.dtypes