Skip to main content

linear_segmentation

Automatic sparse sampling of 1-D array into linear segments minimizing error

Install from clone

pip install .

Install from PYPI

pip install linear_segmentation

Example

python -m linear_segmentation.examples.linear_segmentation_with_slider.py

Usage

from linear_segmentation import linear_segmentation
from linear_segmentation import refinement  # optional
import scipy.interpolation as spint

...
x, y = linear_segmentation(data, tol=0.001)  # normalized abs error tolerance
x_refined, y_refined = refinement(data, x)  # optional refinement using least squares
data_interp = spint.interp1d(x_refined, y_refined)  # or x, y
...
new_y = data_interp(new_x)

Release files for linear-segmentation 0.2.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for linear-segmentation 0.2.post2
File Interpreter ABI Platform
linear_segmentation-0.2.post2-py3-none-any.whl Python 3 none any Details

Release files / linear_segmentation-0.2.post2-py3-none-any.whl

Download URL linear_segmentation-0.2.post2-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd4cbd885faa3f68e632e89f992d2a05720f5c065b8af31d8f3fa76b01505357
BLAKE2b-256 checksum
How to use checksums
47429440d01c775b611d8fdad2c05ad3694b969722ce4b7cfd7e933880735f6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.2.post2 This release

1 release file

0.2

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page