📜  删除列熊猫列表 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:04.357000             🧑  作者: Mango

代码示例6
# Drop The Original Categorical Columns which had Whitespace Issues in their values
df.drop(cat_columns, axis = 1, inplace = True)

dict_1 = {'workclass_stripped':'workclass', 'education_stripped':'education', 
         'marital-status_stripped':'marital_status', 'occupation_stripped':'occupation',
         'relationship_stripped':'relationship', 'race_stripped':'race',
         'sex_stripped':'sex', 'native-country_stripped':'native-country',
         'Income_stripped':'Income'}

df.rename(columns = dict_1, inplace = True)
df