'How To Use Plorly When I Use groupby in which i used Value_counts ( Pandas Lib )
I Want To Visualize How Many Each Rate In Each Category Type, So I Used
q2 = df.groupby(['Category'])['Rating'].value_counts()
To Group The Data as I Need ( It Works Fine As I Need ), But When I Use
px.bar( q2, x = 'Category', y = 'Rating' )
I get " 'DataFrameGroupBy' object has no attribute 'value_counts' " Error, So What Can I Do It To Visualize This Groupby Value_counts Data?
Data Link: https://www.kaggle.com/lava18/google-play-store-apps
Solution 1:[1]
So DataFrameGroupBy Object doesnt have value_counts but it does have sum
q2 = df.groupby(['Category', 'Rating'], as_index=False).sum()
Link to pandas docs
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
