{"id":24742,"library":"tsmoothie","title":"tsmoothie","description":"A Python library for timeseries smoothing and outlier detection in a vectorized way. It provides multiple smoothing techniques (e.g., Convolutional, Exponential, Lowess, Kalman, Spectral) and outlier detection methods. Current version is 1.0.5. Release cadence is intermittent.","status":"active","version":"1.0.5","language":"python","source_language":"en","source_url":"https://github.com/cerlymarco/tsmoothie","tags":["timeseries","smoothing","outlier-detection","forecasting","kalman-filter","lowess"],"install":[{"cmd":"pip install tsmoothie","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for array operations","package":"numpy","optional":false},{"reason":"Required for some smoothing methods (e.g., Lowess, Spline)","package":"scipy","optional":false},{"reason":"Used for KNN-based outlier detection","package":"scikit-learn","optional":true},{"reason":"Required for DecomposeSmoother and some statistical tests","package":"statsmodels","optional":true}],"imports":[{"note":"All smoothers are in tsmoothie.smoother module","symbol":"ConvolutionalSmoother","correct":"from tsmoothie.smoother import ConvolutionalSmoother"},{"note":"","symbol":"LowessSmoother","correct":"from tsmoothie.smoother import LowessSmoother"},{"note":"","symbol":"ExponentialSmoother","correct":"from tsmoothie.smoother import ExponentialSmoother"},{"note":"Added in v1.0.1","symbol":"SpectralSmoother","correct":"from tsmoothie.smoother import SpectralSmoother"},{"note":"Added in v0.2.0","symbol":"DecomposeSmoother","correct":"from tsmoothie.smoother import DecomposeSmoother"},{"note":"","symbol":"KalmanSmoother","correct":"from tsmoothie.smoother import KalmanSmoother"},{"note":"Utility for window-based operations","symbol":"WindowWrapper","correct":"from tsmoothie.utils import WindowWrapper"},{"note":"Utility to load example datasets","symbol":"load_dataset","correct":"from tsmoothie.datasets import load_dataset"}],"quickstart":{"code":"import numpy as np\nfrom tsmoothie.smoother import LowessSmoother\n\n# Generate noisy data\nnp.random.seed(42)\ndata = np.cumsum(np.random.randn(100)) + 10\n\n# Set up smoother\nsmoother = LowessSmoother(smooth_fraction=0.1, iterations=1)\nsmoother.smooth(data)\n\n# Access smoothed and intervals\nsmoothed = smoother.smooth_data[0]\nlow, up = smoother.get_intervals('prediction_interval')\n\nprint('Smoothed:', smoothed[:5])","lang":"python","description":"Basic smoothing with LowessSmoother. Tsmoothie operates on 2D arrays (time series in rows). Ensure data is float and shape (n_series, n_points)."},"warnings":[{"fix":"If you have a 1D array x, use x.reshape(1, -1) or [x] before passing to smoother.","message":"Data must be 2D array-like of shape (n_series, n_points). Even a single series must be shaped (1, n_points) or a list of lists.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert data to float: data.astype(float).","message":"Smoothers expect data in float dtype. Integer arrays may cause incorrect results or errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use from tsmoothie.smoother import ... instead of from tsmoothie import ...","message":"In v1.0.2, the code was restructured: many imports moved to submodules. Previously some classes might have been importable directly from tsmoothie.","severity":"breaking","affected_versions":">=1.0.2"},{"fix":"Stay updated with CHANGELOG.","message":"The method 'get_intervals' parameter 'prediction_interval' is still valid, but future versions may change the API. No official deprecation yet.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from tsmoothie.smoother import ConvolutionalSmoother'","cause":"The import path changed in v1.0.2; you need to import from submodule.","error":"ImportError: cannot import name 'ConvolutionalSmoother' from 'tsmoothie'"},{"fix":"Reshape data: data.reshape(1, -1) for a single series.","cause":"Passed a 1D array instead of 2D.","error":"ValueError: Data must be 2-dimensional"},{"fix":"Check the specific smoother's documentation for correct parameters.","cause":"The smoother's __init__ may accept window parameter, but some like LowessSmoother use 'smooth_fraction'.","error":"TypeError: smooth() got an unexpected keyword argument 'window'"},{"fix":"Run 'pip install tsmoothie'","cause":"Library not installed.","error":"ModuleNotFoundError: No module named 'tsmoothie'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}