def compute_histogram(data, bins=36):
h, x, y = np.histogram2d(data[data.columns[0]], data[data.columns[1]], bins=bins, normed=True)
xc = (x[:-1] + x[1:]) / 2
yc = (y[:-1] + y[1:]) / 2
coords = np.array([(xi, yi) for xi in xc for yi in yc])
theta = coords[:, 0]
r = coords[:, 1]
return h.flatten(), theta, r
评论列表
文章目录