title: How to select good knot sequences for "scipy.interpolate.make_lsq_spline"
body: <p>I want to create a B Spline smoothing a 2D data sequences using <code>scipy.interpolate.make_lsq_spline</code>.</p>
  <pre><code>x = [0., 0.37427465, 0.68290943, 0.83261929, 1. ]
  y = [-1.0, 3.0, 4.0, 2.0, 1.0] 
  </code></pre>
  <p>But, I don't know how to select proper <code>t</code>, the error message does not make sense for me.</p>
  <pre><code>In [1]: import numpy as np
  
  In [2]: from scipy.interpolate import make_lsq_spline
  
  In [3]: x = [0., 0.37427465, 0.68290943, 0.83261929, 1. ]
  
  In [4]: y = [-1.0, 3.0, 4.0, 2.0, 1.0]
  
  In [5]: t = [0.,0.,0.,0.,0.25,0.5,0.75,1.,1.,1.,1 ]
  
  In [6]: spl = make_lsq_spline(x, y, t)
  ---------------------------------------------------------------------------
  LinAlgError                               Traceback (most recent call last)
  &lt;ipython-input-6-4440a73d26f0&gt; in &lt;cell line: 1&gt;()
  ----&gt; 1 spl = make_lsq_spline(x, y, t)
  
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scipy/interpolate/_bsplines.py in make_lsq_spline(x, y, t, k, w, axis, check_finite)
     1513
     1514     # have observation matrix &amp; rhs, can solve the LSQ problem
  -&gt; 1515     cho_decomp = cholesky_banded(ab, overwrite_ab=True, lower=lower,
     1516                                  check_finite=check_finite)
     1517     c = cho_solve_banded((cho_decomp, lower), rhs, overwrite_b=True,
  
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scipy/linalg/_decomp_cholesky.py in cholesky_banded(ab, overwrite_ab, lower, check_finite)
      280     c, info = pbtrf(ab, lower=lower, overwrite_ab=overwrite_ab)
      281     if info &gt; 0:
  --&gt; 282         raise LinAlgError(&quot;%d-th leading minor not positive definite&quot; % info)
      283     if info &lt; 0:
      284         raise ValueError('illegal value in %d-th argument of internal pbtrf'
  
  LinAlgError: 5-th leading minor not positive definite
  </code></pre>
  <p>Is there any guideline for selecting proper knot sequense <code>t</code>?</p>