Guest User

Untitled

a guest
May 20th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. raise LinAlgError('Matrix is singular.')
  2.  
  3. LinAlgError: Matrix is singular.
  4.  
  5. #2-d interpolation
  6. import numpy as np
  7. from scipy import interpolate
  8. import pandas as pd
  9. #Read the Dataset from Excel File
  10. dataset=pd.read_excel('Messwerte_FIBRE.xlsx')
  11. dataset=dataset.drop([0])
  12. index1=[1]
  13. index4=[9]
  14. x1=dataset.iloc[:, index1]
  15. y=dataset.iloc[:, index4]
  16. #converting string into array
  17. x1np=np.array(x1,dtype=float)
  18. ynp=np.array(y,dtype=float)
  19. def func(x1np,x2np):
  20. return (x1np+x2np)*np.exp(-5.0*(x1np**2 + x2np**2))
  21. fvals = func(x1np,ynp)
  22. newfunc = interpolate.Rbf(x1np, ynp, fvals,function='thin-plate')
Add Comment
Please, Sign In to add comment