I have this dataframe shown in the picture below: enter image description here
There are more categories shown and my goal is to slice through each of the 33 categories to get the number of unique usernames. I though about doing something like this:
SexualHealth = df2.loc["Sexual Health & STDs"]
WomenHealth = df2.loc["Women's Health"]
WeightLoss = df2.loc["Weight Loss"]
MentalHealth = df2.loc["MentalHealth"]
Then go to each dataframe and do this:
SexualHealth_unique= SexualHealth['username'].value_counts()
But I would like to know if there is a faster way to get the number of unique users for each category in a single command of something that is fastener that what I am doing right now.