can't add categories to a category dtype in pandas
I have a pandas dataframe with a field called "promo_type" which I converted to categorical by using astype: df[‘promo_type’] = df[‘promo_type’].astype(‘category’) Later on in the code I want to add another category to the field, as follows: df[‘promo_type’].add_categories(‘0’) And I get this error: AttributeError: ‘Series’ object has no attribute ‘add_categories’ I have checked that my… Read More can't add categories to a category dtype in pandas