Skip to main content

Data analysis of peak and valley regions

Project description

Peakoscope

PyPI version Code style: black

Peakoscope is a python package for hierarchical analysis of peak and valley regions in numeric data.

peak plot

  • Peak and valley regions can be nested, for example, when a large peak region contains smaller subpeak regions.
  • Based on a one-pass algorithm that finds all peak regions and orders them into a tree.
  • Classes for peak/valley objects and tree objects.
  • Optional interfaces to matplotlib, pandas and polars.

Usage examples

Compute the tree of nested peak regions in a data set:

>>> import peakoscope
>>> data = [10, 30, 40, 30, 10, 50, 70, 70, 50, 80]
>>> print(peakoscope.tree(data))
0:10
├─5:10
 ├─9:10
 └─6:8
└─1:4
  └─2:3

From the tree, select default peak regions and print their subarrays of data:

>>> for peak in peakoscope.tree(data).size_filter():
...    print(peak.subarray(data))
... 
[80]
[70, 70]
[30, 40, 30]

Howto files

The github repo contains tutorials and a glossary:

Authors

License

Copyright (C) 2021-2024 Eivind Tøstesen. This software is licensed under GPLv3

Citation

Citation can include one or more of:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peakoscope-1.0.0.tar.gz (30.1 kB view hashes)

Uploaded Source

Built Distribution

peakoscope-1.0.0-py3-none-any.whl (34.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page