Matplotlib Tutorial | How to graph a Grouped Bar Chart (Code included)

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 22

  • @Trapnast
    @Trapnast 4 года назад +2

    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?

  • @netnuggetts
    @netnuggetts 3 месяца назад

    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?

  • @danielkwon3062
    @danielkwon3062 4 года назад +1

    Holy.... Thank you soooo soooo soooo soooo much My graph looks amazing :)

  • @youssefahmed8110
    @youssefahmed8110 4 года назад

    you are genius this was very useful thank youuuuu

  • @rio40c
    @rio40c 4 года назад +1

    Fantastic! Thank you very much!

  • @buiquanghuy9772
    @buiquanghuy9772 2 года назад

    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

  • @paulchelladurai3880
    @paulchelladurai3880 5 лет назад +1

    very useful. can you also let us know how do we remove the top, right and left frames in th graph?

  • @gabriel46567
    @gabriel46567 4 года назад

    how do i plot for example in your case math score against reading score against writing score

  • @JohnSmith-ok9sn
    @JohnSmith-ok9sn 4 года назад

    Very good. Thank you

    • @jiejenn
      @jiejenn  4 года назад

      Glad my video helped.

  • @sabbirahmed4162
    @sabbirahmed4162 4 года назад +1

    how to group 3charts in the same manner without overlapping on one another

  • @luisdavidzapatasanchezestu9402
    @luisdavidzapatasanchezestu9402 3 года назад

    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]

    • @jiejenn
      @jiejenn  3 года назад

      Then you will need to separate the values from a single column.

  • @oooo112211
    @oooo112211 5 лет назад

    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". =(

  • @ramaeid3420
    @ramaeid3420 4 года назад

    how did you count the number of male and female alone without the score just the count

  • @4ngusofficial
    @4ngusofficial 4 года назад

    Thank you very much!!!!!!!!!!!!!!

  • @mateuszgalski9458
    @mateuszgalski9458 4 года назад

    "Error tokenizing data. C error: Expected 1 fields in line 4, saw 2" What does it mean? i did same stuff as you...

    • @mateuszgalski9458
      @mateuszgalski9458 4 года назад

      The line 4 is: df = pd.read_csv("StudentsPerformance.csv")

    • @jiejenn
      @jiejenn  4 года назад

      Looks like there is an invisible line break somewhere in your script. Not sure I can help you in that case.