【发布时间】:2019-11-23 03:39:42
【问题描述】:
我有 2 个数据框温度(y)和比率(x)。在每个数据框中,我有 60 列对应于 60 台不同的机器来测量这两个参数。
现在我为每台机器的 y vs x 绘制了一个图,如下所示:
for column in ratio.columns:
x = ratio[column]
y = temperature[column]
if len(x) != len(y):
x_ind = x.index
y_ind = y.index
common_ind = x_ind.intersection(y_ind)
x = x[common_ind]
y = y[common_ind]
plt.scatter(x,y)
plt.savefig("plot" +column+".png")
plt.clf()
因为我有很多数据点,所以我想对每台机器进行分箱并对每个分箱进行平均,这样每个分箱的平均点为 y。 x 介于 0 和 1 之间,我想每 0.05 分一次分箱,这样就有 20 个分箱。
我通过执行以下操作获得了每台机器的直方图: 对于 x in ratio.columns: ratio.hist(column = x, bins = 20) 但这只是给出事件的数量与比率。
如何链接温度数据框 我是熊猫新手,我不知道该怎么做
【问题讨论】: