📅  最后修改于: 2022-03-11 14:47:12.542000             🧑  作者: Mango
#Two ways to do this
df[['parks', 'playgrounds', 'sports']].apply(lambda x: x.astype('category'))
cols = ['parks', 'playgrounds', 'sports', 'roading']:
public[cols] = public[cols].astype('category')