将X,Y,Z数据集转换为numpy.gradient函数

我有X,Y和Z值的数据集,它们的分布不规则。

  X       Y      Z
874.5   2064.2  215
877.4   2068.8  238
872.1   2060.4  208
880.3   2073.4  286
870.1   2067.2  253
867.7   2063.4  287
883.2   2078.1  295
869.2   2055.9  291

我想确定这些点的梯度,在尝试确定如何解决此问题时,我遇到了第一个障碍。 显然,我可以使用以下代码创建轮廓图:

x = df['X'].values.tolist()
y = df['Y'].values.tolist()
z = df['Z'].values.tolist()

levs = range(round(Min_Delay, -2), round(Max_Delay, -2), 100)

fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.tricontour(x, y, z, levs, linewidths=0.25, colors='red')

plt.scatter(x, y, s=0.5, Label="Drill Hole")
plt.axis('equal')

plt.title('Contours', fontsize=15)
ax1.set_ylabel('Y-Coordinate')
ax1.set_xlabel('X-Coordinate')
plt.show()

I'm assuming I will need to use numpy.gradient however I am not sure how to interpret it's parameters, or take the X Y Z data shown above and input it into the numpy.gradient fuction.

任何帮助,将不胜感激。