简体   繁体   English

pandas 列的 Plot 直方图

[英]Plot histogram of the column pandas

haversine = 

id_easy            meters
0   d14e    140885.533614
1   6024    136171.294532
2   8624    133870.080496
3   782f    133171.023674
4   7a0bc   132869.407625

Plotting histogram:绘制直方图:

haversine.hist(column='meters',bins=50)

Output: Output: 一列

Is it right?这样对吗? Max value is 140885 meters.最大值为140885米。 But I can not see soething like that on plot但我在 plot 上看不到这样的东西

OR how to choose the range from 0 to 200000或者如何选择 0 到 200000 的范围

As suggested by Michael you could try:正如迈克尔建议的那样,您可以尝试:

fig, ax = plt.subplots()
haversine.hist(column='meters', bins=50, ax=ax)
ax.set_yscale('log')

If this doesn't give the answer you expect I suggest you try manually extracting the number of events you expect, count number of rows with greater than 140000 with如果这没有给出您期望的答案,我建议您尝试手动提取您期望的事件数,计算大于 140000 的行数

haversine[haversine['meters']>140000].shape[0]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM