I'm trying to change the type of many columns or range of them, I need to know if exist a easy way to do, I am right?
In:
for col in list(df.columns[2:8]):
df=df.astype({col:'category'})
df.dtypes
Out:
VAERS_ID int64
VAX_TYPE object
VAX_NAME category
SYMPTOM1 category
SYMPTOM2 category
SYMPTOM3 category
SYMPTOM4 category
SYMPTOM5 category
RECVDATE object
ALLERGIES object