question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scipy.signal.bspline does not work for integer types

See original GitHub issue

scipy.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:open
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
poldapcommented, Aug 3, 2021

The PR is ready for you @tupui

0reactions
tupuicommented, May 31, 2022

@Dbhardwaj99 please read my comments.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found