Get a list of categories of categorical variable (Python Pandas)
Try executing the below code.
List_Of_Categories_In_Column=list(df['Categorical Column Name'].value_counts().index)
I have a pandas DataFrame with a column representing a categorical variable. How can I get a list of the categories? I tried .values on the column but that does not return the unique levels.
Thanks!