Automatic sparse sampling of 1-D array into linear segments minimizing error
Project description
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file linear_segmentation-0.2.post2-py3-none-any.whl
.
File metadata
- Download URL: linear_segmentation-0.2.post2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4cbd885faa3f68e632e89f992d2a05720f5c065b8af31d8f3fa76b01505357 |
|
MD5 | 9dd4d98276f54d2e35b7e13178ea9b79 |
|
BLAKE2b-256 | 47429440d01c775b611d8fdad2c05ad3694b969722ce4b7cfd7e933880735f6e |