Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. from scipy.interpolate import LinearNDInterpolator as LND
  2.  
  3. Ddump = pd.read_csv('C:....csv', header='infer', low_memory=False, dtype = np.float64)
  4.  
  5. X = Ddump.iloc[:,:4].values
  6. Y = Ddump.iloc[:,4:].values
  7.  
  8. hull={}
  9. List = Ddump.iloc[:,4:].head().columns.to_list()
  10. for i in range(Y.shape[1]):
  11. Fit = LND(X,Y[:,i])
  12. hull[List[i].format(i)] = Fit
  13.  
  14. Set = 'S19'
  15. PVec = np.array([0.1111 , 67.42, -.22, 1.97])
  16.  
  17. [in] hull[Set](PVec)
  18. [out] array([2179.0411926])
  19.  
  20. @xw.func
  21. @xw.arg('Set', str)
  22. @xw.arg('Prices', np.array, ndim=2)
  23. def LND(Set,Prices):
  24. return hull[Set](Prices)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement