Calculating gradient in 3D
问题 I have the following set of points in 3d-space and D'd like to calculate the gradient everywhere, i.e. have a vector field returned. points = [] for i in np.linspace(-20,20,100): for j in np.linspace(-20,20,100): points.append([i,j,i**2+j**2]) points = np.array(points) It's an elliptic paraboloid. Using np.gradient(points) , http://docs.scipy.org/doc/numpy/reference/generated/numpy.gradient.html I neither get the correct values nor the dimension I would expect. Can anyone give me a hint? 回答1: