text_plain_output_1.png
columns_to_drop = []
columns = train_data.columns
for i in range(len(columns) - 1):
    column_to_check = train_data[columns[i]]
    for c in range(i + 1, len(columns)):
        if np.array_equal(column_to_check, train_data[columns[c]].values):
            columns_to_drop.append(columns[c])
train_data.drop(columns_to_drop, axis=1, inplace=True)
test_data.drop(columns_to_drop, axis=1, inplace=True)
print('Data after cleaning')
print('Train data shape: ', train_data.shape, 'Test data shape: ', test_data.shape)