Metadata-Version: 2.3 Name: csaps Version: 1.3.3 Summary: Cubic spline approximation (smoothing) License: MIT Keywords: cubic,spline,approximation,smoothing,interpolation,csaps Author: Evgeny Prilepin Author-email: esp.home@gmail.com Requires-Python: >=3.10 Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Scientific/Engineering :: Mathematics Classifier: Topic :: Software Development :: Libraries Requires-Dist: numpy (>=1.26.2) ; python_version >= "3.12" Requires-Dist: numpy ; python_version < "3.12" Requires-Dist: scipy (>=1.11.4) ; python_version >= "3.12" Requires-Dist: scipy ; python_version < "3.12" Requires-Dist: typing-extensions Project-URL: Documentation, https://csaps.readthedocs.io Project-URL: Homepage, https://github.com/espdev/csaps Project-URL: Repository, https://github.com/espdev/csaps Description-Content-Type: text/markdown
**csaps** is a Python package for univariate, multivariate and n-dimensional grid data approximation using cubic smoothing splines. The package can be useful in practical engineering tasks for data approximation and smoothing. ## Installing Use pip for installing: ``` pip install -U csaps ``` or Poetry: ``` poetry add csaps ``` The module depends only on NumPy and SciPy. Python 3.10 or above is supported. ## Simple Examples Here is a couple of examples of smoothing data. An univariate data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from csaps import csaps np.random.seed(1234) x = np.linspace(-5., 5., 25) y = np.exp(-(x/2.5)**2) + (np.random.rand(25) - 0.2) * 0.3 xs = np.linspace(x[0], x[-1], 150) ys = csaps(x, y, xs, smooth=0.85) plt.plot(x, y, 'o', xs, ys, '-') plt.show() ```