numbins = 10
H, xedges, yedges = np.histogram2d(x_axis, y_axis, bins=numbins, weights=z_axis
    )
count, x, y = np.histogram2d(x_axis, y_axis, bins=numbins)
H /= count
гистограмма numpy с 3 переменными