Comments (4)
Hi @ev-br , thanks a lot for the quick response. Indeed, I can confirm that the error occurs for (and only for, as far as I see) a dataset with NaNs (and previously, instantiation was possible even with NaNs being present). I will investigate further if I still see a discrepancy in performance for a dataset without NaNs, using the _legacy
methods. However, if _legacy
methods should be identical to before also if NaNs are present, I can already tell that it does not seem to be the case for me, and I will see if I can create a minimal data set to reproduce it.
from scipy.
-
the error indicates that
values
have infs or nans. This is indeed a problem, and the fact that it worked previously is an accident, really. -
_legacy
methods should be exactly identical to what it was in the previous scipy releases. If they are not, it's a bug. Would you please be able to add a minimal reproducible example for us to take a look?
from scipy.
Dear @ev-br , I investigated further and contrarily to what I previously claimed, I see no difference between the _legacy
methods in scipy 1.13 and the corresponding methods in scipy < 1.13. So everything seems to work as expected and this issue can be closed I guess. However, let me allow to ask two questions:
- As the new spline
RegularGridInterpolator
instantiation may take significantly more time than before for the benefit of faster interpolation afterwards, aren't there case where a different trade-off is desired, i.e., fast instantiation is more important? So to permanently allow to choose the most suitable method in the future? - Shouldn't it be possible (at one's own risk) to allow interpolation on a grid containing NaNs?
Thanks a lot again for your support!
from scipy.
Thanks for confirming the _legacy
behavior!
aren't there case where a different trade-off is desired, i.e., fast instantiation is more important? So to permanently allow to choose the most suitable method in the future?
Sure. Only a user can decide what's most suitable for their specific problem though. The best a library can do is to offer a choice, here between cubic
or cubic_legacy
etc.
Shouldn't it be possible (at one's own risk) to allow interpolation on a grid containing NaNs?
Sure.
Just keep ising linear
, nearest
and _legacy
methods :-).
Alternatively, you can provide your own solver
argument. It should look like sparse.linalg.solve
or iterative solvers from sparse.linalg
, that's the only requirement. See https://github.com/scipy/scipy/blob/main/scipy/interpolate/_ndbspline.py#L355
I'm sceptical TBH --- the 'missing value' nan
semantics is inherently at odds with the 'not-a-number' semantics that scipy.linalg and scipy.interpolate adhere to. But don't let my skepticism discourage you, I'd be happy to be proven wrong. So if you manage to make it work, do let us know!
from scipy.
Related Issues (20)
- BUG: `interpolate.BSpline.basis_element` differs from `BSpline` on the last spline HOT 1
- BUG: scipy.optimize.curve_fit full_output and boundaries incompatible HOT 1
- DOC/DEV: Developer docs should mention Accelerate support HOT 5
- BUG: stats.kstest: units stripped from `astropy.unit.Quantity` objects starting with 1.12.0 HOT 1
- BUG: `zsh: abort python` after `scipy.linalg.sqrtm` on empty `np.array` on M1 Macbook via conda HOT 1
- BUG: special.lpmv(0,v,-1) returns incorrect value for non-integer v
- ENH: integrate: evaluate simultaneously a function and its jacobian for ODE integration HOT 2
- BUG: sparse.csgraph.dijkstra errors on inputs with int64 or no indices
- BUG: positional argument `DeprecationWarning` message is overly long HOT 10
- TST: TestEig.test_singular failing tolerance with generic BLAS installed HOT 2
- BUG: interpolate.griddata: memory leak in linear mode under Python 3.12 HOT 10
- DOC: Old SciPy version in embedded Jupyterlite notebooks HOT 13
- DOC: stats: wrong docstrings of `*Result` classes HOT 2
- BUG: Can't build scipy on main (1.15.0.dev0), PyObject_Vectorcall* not found HOT 3
- ENH: integrate: add array API-support HOT 2
- MAINT: Premature setting of attributes in `HBInfo` in `scipy.io._harwell_boeing`. HOT 2
- TST: tolerance violations with SciPy 1.14.0rc1 on linux-{aarch64,ppc64le} HOT 6
- How to extract the p-value from the scipy.stats.ranksums result? HOT 1
- how to compute the exact p HOT 1
- TST: test failures on windows with SciPy 1.14.0rc1 HOT 28
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scipy.