【发布时间】:2017-02-08 13:37:59
【问题描述】:
我有一个包含 20 多列的数据集,其中之一是“Trip_distance”,其中有超过 100,000 行。
这是“Trip_distance”列的示例:
[0 0 0.59 0.74 0.61 1.07 1.43 0.9 1.33 0.84]
然后继续。 我想通过将它们分组到一个范围内来绘制直方图(因为绘制所有 100,000 个值没有意义)。
我试过了
plt.hist(df['Trip_distance'],bins = no_of_rows)
plt.show()
但是代码内存不足。
有没有办法在 python 中做到这一点?
【问题讨论】:
-
如果你先将你的trip_distance列装箱,然后绘制结果呢?
标签: python-2.7 csv pandas matplotlib