-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Term Entry] Python Scipy Function: find_peaks() #5895
base: main
Are you sure you want to change the base?
Conversation
Hey @naajiha please sign the CLA |
signed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @naajiha , thank you for contributing to Codecademy Docs, the entry is nicely written! 😄
I've suggested a few changes, could you please review and modify those at your earliest convenience? Thank you! 😃
@@ -0,0 +1,45 @@ | |||
--- | |||
Title: 'find_peaks()' | |||
Description: 'Finds the peaks in a signal.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: 'Finds the peaks in a signal.' | |
Description: 'Finds the indices of local maxima (peaks) in a 1D signal array based on specified conditions.' |
- 'learn-python-3' | ||
--- | ||
|
||
The **`find_peaks()`** function is used to find peaks in a signal. It returns the indices of local maxima in a signal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The **`find_peaks()`** function is used to find peaks in a signal. It returns the indices of local maxima in a signal. | |
In SciPy, the **`find_peaks()`** function identifies the indices of local maxima (peaks) in a 1D signal array based on specified conditions. |
## Syntax | ||
|
||
```pseudo | ||
find_peaks(signal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the syntax. Here is the reference documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html
The `signal` parameter is an array of numbers. | ||
|
||
The default height of the peaks is defined by the height parameter. If the parameter is unspecified, the height is set to 0. The width parameter is used to filter out peaks that have a width less than the specified width. The rel_height parameter is used to filter out peaks that have a relative height less than the specified relative height. The threshold parameter is used to filter out peaks that have a value less than the specified threshold. The distance parameter is used to filter out peaks that have a distance between peaks less than the specified distance. The prominence parameter is used to filter out peaks that have a prominence less than the specified prominence. The wlen parameter is used to filter out peaks that have a width less than the specified width. The plateau_size parameter is used to filter out peaks that have a plateau size less than the specified plateau size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the parameters should be in bullet points, an example could be:
x
: The input 1D array or signal in which peaks are to be identified.height
: Specifies the required height of peaks. A tuple can set minimum and maximum peak heights.threshold
: Specifies the required threshold for the vertical distance between a peak and its neighbors.- .
- .
- .
print(peaks) | ||
``` | ||
|
||
The above code creates a signal with some peaks, finds the peaks in the signal, and prints the indices of the peaks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showcase the output of this code using a shell
block
Description
-Added the find_peaks() term for python from the scipy package
-Closes issue #5853
Issue Solved
Type of Change
Checklist
main
branch.Issues Solved
section.