Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- raise LinAlgError('Matrix is singular.')
- LinAlgError: Matrix is singular.
- #2-d interpolation
- import numpy as np
- from scipy import interpolate
- import pandas as pd
- #Read the Dataset from Excel File
- dataset=pd.read_excel('Messwerte_FIBRE.xlsx')
- dataset=dataset.drop([0])
- index1=[1]
- index4=[9]
- x1=dataset.iloc[:, index1]
- y=dataset.iloc[:, index4]
- #converting string into array
- x1np=np.array(x1,dtype=float)
- ynp=np.array(y,dtype=float)
- def func(x1np,x2np):
- return (x1np+x2np)*np.exp(-5.0*(x1np**2 + x2np**2))
- fvals = func(x1np,ynp)
- newfunc = interpolate.Rbf(x1np, ynp, fvals,function='thin-plate')
Add Comment
Please, Sign In to add comment