【发布时间】:2018-12-21 00:05:53
【问题描述】:
我的数据显示在带有以下代码的直方图中: 角度=数据[列[3]]
num_bins = 23
avg_samples_per_bin = 200
# len(data['steering'])/num_bins
hist, bins = np.histogram(data['steering'], num_bins)
width = 0.7 * (bins[1] - bins[0])
center = (bins[:-1] + bins[1:]) * 0.5
plt.bar(center, hist, align='center', width=width)
plt.plot((np.min(angles), np.max(angles)), (avg_samples_per_bin, avg_samples_per_bin), 'k-')
显示以下内容:
我正在寻找一个可以删除行上所有数据的函数。或者换句话说,每个 bin 中的数据不能超过 200。
有没有一种巧妙的方法来做到这一点?
【问题讨论】:
标签: python numpy matplotlib