val = tran_col.split("_")[1]
X.loc[X[tran_col] == 1, col] = val
else:
value_array = np.array([int(col0.split("_")[1]) for col0 in col_list])
X[col] = np.dot(X[col_list].values, value_array.T)
out_cols = [col0 for col0 in out_cols if col0 not in col_list]
After Change
for col in cols:
col_list = [col0 for col0 in out_cols if str(col0).startswith(col)]
prefix_length = len(col)+1 // Original column name plus underscore
if self.use_cat_names:
X[col] = 0
for tran_col in col_list: