Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alibahaari/peaksvalleys
Detect peaks and valleys in a list of numbers.
https://github.com/alibahaari/peaksvalleys
python python-3 python-module python-package python-script python3 python36 python37
Last synced: 3 days ago
JSON representation
Detect peaks and valleys in a list of numbers.
- Host: GitHub
- URL: https://github.com/alibahaari/peaksvalleys
- Owner: AliBahaari
- License: mit
- Created: 2021-09-15T05:26:58.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-24T10:27:38.000Z (about 3 years ago)
- Last Synced: 2024-09-30T19:17:42.527Z (3 days ago)
- Topics: python, python-3, python-module, python-package, python-script, python3, python36, python37
- Language: Python
- Homepage: https://pypi.org/project/PeaksValleys/
- Size: 4.88 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PeaksValleys
Consider you have a list containing multiple numbers. By using ***PeaksValleys*** package, you can find and detect peaks and valleys.
## Screenshots
![PeaksValleys Screenshot](https://user-images.githubusercontent.com/8419324/134659955-6ad34a8a-df35-4c7c-bdf5-de7e0bb6e643.png)
## Usage
```python
from PeaksValleys import detectPeaksValleys
import random
import pandas as pdrandItems = random.sample(range(1, 200), 100)
data = {
'Numbers': randItems
}
df = pd.DataFrame(data=data)print(detectPeaksValleys(df['Numbers'], 21, 8))
```As you see, `detectPeaksValleys` has 3 parameters:
```python
detectPeaksValleys(dataframeSeries, rollingNumber, averageSize):
```1. `dataframeSeries` is series created by `pandas` package
2. `rollingNumber` is a number for smoothing numbers sequence (the higher number, the smoother sequence)
3. `averageSize` is a count of numbers creating an interval for detecting peaks and valleys (the less number, the more peaks and valleys)## License
[MIT](https://choosealicense.com/licenses/mit/)