How about if i want to add the 3rd bar? should i just add something = ax.bar(indx + bar_width/2, something, bar_width, label='something') ? like the 2nd one?
imp_stats = ['wins','losses'] df.groupby('Ability')[imp_stats].mean().plot(kind='bar',figsize=(10,6)) plt.xlabel('Abilites') plt.ylabel('Total') plt.title('Wins and Looses according to Prestige') can this be also considered as the right way?
hi, so after groupby we have a new dataframe named dataset. How do i retrieve data about all variables in the first column ? I tried something like col1 = dataset['gender'] but it return error, while dataset['math score'] works. Edit: nvm found it, just add .reset_index() when grouping
groups you do by columns. how could you separate the values if they are in single column? for example: column GENER and the values are [female, male, bisexual, lgtbi]
I managed to plot the graphs by modifying your code to fit my data set. However the legend cannot be created due to "No handles with labels found to put in legend". =(
How about if i want to add the 3rd bar? should i just add something = ax.bar(indx + bar_width/2, something, bar_width, label='something') ? like the 2nd one?
imp_stats = ['wins','losses']
df.groupby('Ability')[imp_stats].mean().plot(kind='bar',figsize=(10,6))
plt.xlabel('Abilites')
plt.ylabel('Total')
plt.title('Wins and Looses according to Prestige')
can this be also considered as the right way?
Holy.... Thank you soooo soooo soooo soooo much My graph looks amazing :)
you are genius this was very useful thank youuuuu
Fantastic! Thank you very much!
hi, so after groupby we have a new dataframe named dataset. How do i retrieve data about all variables in the first column ? I tried something like col1 = dataset['gender'] but it return error, while dataset['math score'] works.
Edit: nvm found it, just add .reset_index() when grouping
very useful. can you also let us know how do we remove the top, right and left frames in th graph?
Do you mean the borders on the outsid
@@jiejenn Yes
how do i plot for example in your case math score against reading score against writing score
Very good. Thank you
Glad my video helped.
how to group 3charts in the same manner without overlapping on one another
groups you do by columns. how could you separate the values if they are in single column?
for example: column GENER and the values are [female, male, bisexual, lgtbi]
Then you will need to separate the values from a single column.
I managed to plot the graphs by modifying your code to fit my data set. However the legend cannot be created due to "No handles with labels found to put in legend". =(
how did you count the number of male and female alone without the score just the count
use groupby and size()
Thank you very much!!!!!!!!!!!!!!
"Error tokenizing data. C error: Expected 1 fields in line 4, saw 2" What does it mean? i did same stuff as you...
The line 4 is: df = pd.read_csv("StudentsPerformance.csv")
Looks like there is an invisible line break somewhere in your script. Not sure I can help you in that case.