def convert_categories(cat_list): for col in cat_list: df[col] = df[col].astype('category') df[f'{col}_cat'] = df[f'{col}_cat'].cat.codes.
確定! 回上一頁