Skip to content
multi-dimensional splines
Branch: master
Clone or download
sixpearls Merge pull request #29 from kb-press/silence-lstsq-warning
Pass rcond to lstsq to silence warning
Latest commit e2b879d Jun 23, 2019



This is a Python package for multivariate B-splines with performant C(ython) and NumPy implementations.


The easiest way to use ndspliens is to call make_interp_spline or make_lsq_spline on your problem data, as in

import ndsplines
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(-3, 3, 50)
y = np.exp(-x**2) + 0.1 * np.random.randn(50)

t = [-1, 0, 1]
k = 3
t = np.r_[(x[0],)*(k+1),

ndspl = ndsplines.make_lsq_spline(x, y, t, 3)

xs = np.linspace(-3, 3, 100)
plt.plot(x, y, 'o', ms=5)
plt.plot(xs, ndspl(xs).squeeze(), label='LSQ spline')


Install ndsplines with pip:

$ pip install ndsplines

or from source:

$ git clone
$ cd ndsplines
$ pip install -e .

Note that in order to use the C(ython) implementation, NumPy must be installed and a C compiler configured before installing ndsplines.


Build the docs:

$ pip install -e .[docs]
$ cd docs
$ make html
You can’t perform that action at this time.