0
棒グラフiが2列パンダ大きなデータグループX軸
+----------+------------+
| id| orders |
+----------+------------+
| 1 | 1100 |
| 2 | 22753 |
| 3 | 34 |
| 4 | 11 |
| 5 | 430 |
| 6 | 1175 |
| ... | .. |
| 800 | 17 |
+----------+------------+
が含まパンダ・データ・フレーム中のAAテーブルを持っています1-100,100-200,200-300というように700から800まで、
とy軸方向のそれぞれの総受注
、私を助けて私は
を使用していてくださいmatplotlib.pyこれのためのパッケージ。
iはfig = plt.figure(figsize=(17, 6)) # Create matplotlib figure
ax = fig.add_subplot(111) # Create matplotlib axes
width = 0.2
df.orders.plot(kind='bar', color='red', ax=ax, width=width, position=1)
ax.legend()
plt.show()
occurancesが誤っているこのコードを実行しようとした、オーダー
df.plot(kind = 'bar'、color = 'red'、ax = ax、width = width、position = 1)。これを試すことができますか? – Backtrack
@Backtrack私はそれを試みましたが、x軸上では、1から800までの別個のバーがあります。これは適切ではありません。私は1-100,100-200などのグループでそれを使います。 –
新しい 'dataframe'を作成し、これは8行とそれに対応する次数の合計を持ちます。 – jbndlr