Home > other >  Matplotlib don't show Float values on axis
Matplotlib don't show Float values on axis

Time:01-15

result is pandas dataframe with float64 values on Total Academic Expectations Score and Parent Response Rate.
It does make Plot but on x-axis instead of float numbers it shows 0s only.

DataFrame looks like this: (there are much more rows ofc)

DBN Total Academic Expectations Score Parent Response Rate
0 01M015 8.2 0.71
0 01M019 7.7 0.92
result['Total Academic Expectations Score'].groupby(result['Parent Response Rate']).plot(kind ='bar')
plt.tight_layout()
plt.show() 

I've tried tight layout as shown but it was unsuccessful.

note: Parent Response Rate is 0 to 1 float, and Total Academic Expectations Score is 0 to 10 float

enter image description here

I want to show what is the mean of the Total Academic Expectations Score for the same Parent Response Rate

CodePudding user response:

Try:

result.groupby('Parent Response Rate')['Total Academic Expectations Score'].mean().plot(kind='bar', rot=45)
  •  Tags:  
  • Related