Answers for "two columns into 1 creating categorical pandas"

1

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')
Posted by: Guest on November-27-2020

Code answers related to "two columns into 1 creating categorical pandas"

Python Answers by Framework

Browse Popular Code Answers by Language