【发布时间】:2018-05-12 10:33:23
【问题描述】:
我有一个这样的超简单系列:
hour
0 438
1 444
2 351
3 402
4 473
5 498
6 440
7 431
8 259
9 11
11 52
12 62
13 77
14 55
22 40
23 162
Name: value, dtype: int64
这只是在给定小时内对某事物的观察次数的计数。如何在 Jupyter 笔记本中快速轻松地将其绘制为直方图?第一个 bin 是从 0 到 1 小时(00:00 到 01:00),第二个 bin 是从 1 到 2 小时(01:00 到 02:00)等等。
【问题讨论】:
-
你的意思是简单的条形图:
ser.plot.bar()? -
s.plot(kind='bar')? -
看看
matplotlib或我个人最喜欢的seaborn
标签: python pandas numpy matplotlib histogram