def calc_prob(x, y):
    return kde([x, y])[0]
calc_prob = vectorize(calc_prob)
if ax is None:
    fig = plt.figure(figsize=(6, 6))
ax = fig.add_subplot(1, 1, 1)
X, Y = np.meshgrid(xs, ys)
Z = calc_prob(X, Y)
cont = ax.contour(X, Y, Z)
point_values = kde(data.T)
print(point_values)
ax.scatter(data[:, (0)], data[:, (1)], c=point_values)
return None, None
data_x = np.random.random((50, 2))
cont = plot_2d_probsurface(data_x)
Окрасьте точки в соответствии с цветом их контура