I have a dataframe that hs 2 columns
Text Categories
"Hi Hello" [F35, B3, C98]
"Where is" [G58, F35, C17]
"Is she?!" [T92, F35, B3]
the field Categories is an array of Categories
I want to find how many distinct Categories I have
I tried this code but did not work
print(len(sorted(set(df['Categories']))))
I tried this but it was just for one record !
print(len(sorted(set(df['Categories'][0]))))
I did not know how to do it for all categories in the dataframe?
df['Categories'].explode().value_counts()