result是具有 float64 值的 pandas 資料框Total Academic Expectations Score和Parent Response Rate。
它確實制作了 Plot,但在 x 軸上而不是浮點數上它只顯示 0。
DataFrame 看起來像這樣:(c 的行要多得多)
| 資料庫網路 | 總學術期望分數 | 家長回應率 | |
|---|---|---|---|
| 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()
我已經嘗試過如圖所示的緊湊布局,但沒有成功。
注意:Parent Response Rate是 0 到 1 浮點數,并且Total Academic Expectations Score是 0 到 10 浮點數

我想顯示相同家長回應率的總學術期望分數的平均值是多少
uj5u.com熱心網友回復:
嘗試:
result.groupby('Parent Response Rate')['Total Academic Expectations Score'].mean().plot(kind='bar', rot=45)
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/412622.html
標籤:
上一篇:陣列中的例外值去除技術
