简体   繁体   中英

Is there a way to use the scipy.interpolate rbf function without compiling?

I want to use the "rbf" function from scipy.interpolate without installing neither scipy nor cython. First I tried to import only the source code of the rbf-function. But Rbf itselfs want to import other functions among others .pxd-files wherein cython is used, which is also not installed on the maschine the python script is running on. Is there a way to use the 2dinterpolation rbf without compiling scipy? Many thanks in advance

Assuming you cannot get a scipy wheel for your platform, nor you can use eg Anaconda, you can of course just take https://github.com/scipy/scipy/blob/v0.18.1/scipy/interpolate/rbf.py#L57-L240 and try to use the code standalone. There will be two issues to solve:

  • scipy.special.xlogy . This is just x*log(y) with special care taken so that it's equal zero for x=0. Can easily replicate in pure python or numpy if needs be.

  • scipy.linalg.solve . If you have numpy, you can replace it with numpy.linalg.solve . If you don't have numpy, uhm, well, you've a problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM