scipy.signal.bspline does not work for integer types
See original GitHub issuescipy.signal.bspline
gives zero output for integer types. This also affects quadratic and cubic.
Reproducing code example:
An example of an incorrect result
>>> from scipy.signal import bspline, quadratic, cubic
>>> bspline(np.array([-3,-2,-1,0,1,2,3]), 6)
array([0, 0, 0, 0, 0, 0, 0])
What was expected
>>> bspline(np.array([-3,-2,-1,0,1,2,3]).astype(float), 6)
array([2.17013889e-05, 1.56684028e-02, 2.28797743e-01, 5.11024306e-01,
2.28797743e-01, 1.56684028e-02, 2.17013889e-05])
Scipy/Numpy/Python version information:
>>> import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
1.7.0 1.21.1 sys.version_info(major=3, minor=7, micro=5, releaselevel='final', serial=0)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
scipy.interpolate.BSpline — SciPy v1.9.3 Manual
If True, extrapolates the first and last polynomial pieces of b-spline functions active on the base interval. If 'periodic', periodic extrapolation is used....
Read more >Difficulties to use scipy.interpolate BSpline: "TypeError
This answer is based on https://github.com/scipy/scipy/issues/10389. The general suggestion over there applies: if you want interpolation, ...
Read more >scipy.interpolate.BSpline.design_matrix
Returns a design matrix as a CSR format sparse array. ... Whether to extrapolate based on the first and last intervals or raise...
Read more >Scientific Programming with B-Splines | bsplines.org
It is not difficult to implement B-splines yourself. ... (B-)spline functionality in its two modules scipy.signal and scipy.interpolate .
Read more >SciPy Reference Guide - SAVOIR
SciPy (pronounced “Sigh Pie”) is open-source software for mathematics, ... However, in this case, A (t) and its integral do not commute.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The PR is ready for you @tupui
@Dbhardwaj99 please read my comments.