Skip to content

[Term Entry] Python Scipy Function: find_peaks() #5895

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

Merged
merged 8 commits into from
Jan 18, 2025

Conversation

naajiha
Copy link
Contributor

@naajiha naajiha commented Dec 26, 2024

Description

-Added the find_peaks() term for python from the scipy package
-Closes #5853

Issue Solved

Type of Change

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@CLAassistant
Copy link

CLAassistant commented Dec 26, 2024

CLA assistant check
All committers have signed the CLA.

@mamtawardhani mamtawardhani self-assigned this Dec 26, 2024
@mamtawardhani mamtawardhani added new entry New entry or entries status: under review Issue or PR is currently being reviewed scipy Python scipy enteries labels Dec 26, 2024
@mamtawardhani
Copy link
Collaborator

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Hey @naajiha please sign the CLA

@naajiha
Copy link
Contributor Author

naajiha commented Dec 26, 2024

signed

Copy link
Collaborator

@mamtawardhani mamtawardhani left a 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! 😃

## Syntax

```pseudo
find_peaks(signal);
Copy link
Collaborator

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

Comment on lines 23 to 25
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.
Copy link
Collaborator

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.
Copy link
Collaborator

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

@mamtawardhani
Copy link
Collaborator

Hey @naajiha are you still working on this?

@naajiha
Copy link
Contributor Author

naajiha commented Jan 10, 2025

yes, sorry, my computer was getting fixed, it was broken

@naajiha
Copy link
Contributor Author

naajiha commented Jan 10, 2025

I pushed the changes, let me know if you are able to see them

Copy link
Collaborator

@mamtawardhani mamtawardhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing to Codecademy Docs @naajiha 😄

The entry looks good for a second round of review! 🚀

Copy link
Collaborator

@Sriparno08 Sriparno08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @naajiha!

@Sriparno08 Sriparno08 merged commit a3cd90c into Codecademy:main Jan 18, 2025
6 checks passed
Copy link

👋 @naajiha
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/scipy/scipy-signal/find-peaks

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, visit the linked accounts page and ensure that your GitHub account is linked.

@Sriparno08 Sriparno08 added status: review 2️⃣ completed and removed status: under review Issue or PR is currently being reviewed labels Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] Python:SciPy scipy.signal : find_peaks()
4 participants