I have a matrix of dataframe 128x128 and I want to make it equidistance for interpolation how can I do it? Here is the grid from that data frame and now there are points that are not the same distance.How can I make this uniformly spaced.
CodePudding user response:
Do you want something like this? You can change the number of points as you want, just change a
.
import numpy as np
import matplotlib.pyplot as plt
a = np.linspace(0,3,4)
grid = np.dstack(np.meshgrid(a,a))
plt.scatter(grid[:,:,0],grid[:,:,1])
plt.show()