4. Change the ‘Continent’ column to a category type pandas code example
Example: pandas convert multiple columns to categorical
#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')