Good afternoon, guys!
I am new to python and am tempted to interpolate values between two columns of a rectangular array.
Initially I created an array of zeros (nx=383 nz=125)
. Then I filled in the array at nx=5
and nx=380
. I would like to fill the positions between these two points with an interpolation of the values in these two points. I am tempted to 1d
and 2d
interpolations but both complain that the dimensions are not the same. Can someone help me?
Thankful
# coding: utf-8
# In[1]:
import numpy as np
import matplotlib.pyplot as plt
import math
from scipy.interpolate import interp1d
from scipy.interpolate import griddata
# In[2]:
nx = 383
nz = 125
# In[7]:
perfilf=model[380, 0:125]
plt.plot( perfilf )
plt.title("perfilf")
plt.show()
# In[8]:
perfili=model[5, 0:125]
plt.plot( perfili )
plt.title("perfili")
plt.show()
# In[9]:
m0=np.zeros((nx,nz))
m0[5,:] = perfili
m0[380,:]=perfilf
plt.imshow(m0.T, aspect='auto')
plt.title("teste")
plt.colorbar()
plt.show()