Skip to content
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 - NumPy built-in functions: .argmax() #6434

Merged
merged 5 commits into from
Apr 7, 2025

Conversation

mamtawardhani
Copy link
Collaborator

Description

[Term Entry] Python - NumPy built-in functions: .argmax()

Issue Solved

closes #6424

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.

@mamtawardhani mamtawardhani added new entry New entry or entries numpy NumPy entries status: under review Issue or PR is currently being reviewed labels Mar 29, 2025

## Example 2: Working with Multi-dimensional Arrays

`.argmax()` becomes especially powerful when working with multi-dimensional arrays. By specifying the axis parameter, maximum values along rows or columns can be found, which is useful for tasks like finding the highest value in each feature of a dataset. The example code is:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change the last line, "The example code is".


## Example 3: [Machine Learning](https://www.codecademy.com/resources/docs/general/machine-learning) Applications with `keepdims`

The `.argmax()` function is commonly used in machine learning to identify predicted classes from probability outputs. The `keepdims` parameter is particularly useful when integrating this operation into larger computational graphs. Here is the code:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change the line "Here is the code".


## Example 1: Finding Maximum Element Position in a 1D Array

The simplest application of `.argmax()` is finding the position of the maximum value in a one-dimensional array. This is useful when the position itself carries meaningful information. The code is as follows:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change the line "The code is as follows".

print(f"Top scorer in {subject}: Student {best_students[i] + 1}")
```

Explore the [Learn Statistics with NumPy](https://www.codecademy.com/enrolled/courses/intro-statistics-numpy) course on Codecademy to delve deeper into NumPy functionalities.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this line.

@Radhika-okhade
Copy link
Collaborator

Thank you for contributing to Codecademy docs @mamtawardhani. The entry looks good to be merged.

@Radhika-okhade Radhika-okhade merged commit 3d42b93 into Codecademy:main Apr 7, 2025
7 checks passed
Copy link

github-actions bot commented Apr 7, 2025

👋 @mamtawardhani
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/numpy/built-in-functions/argmax

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] Python - NumPy built-in functions: .argmax()
2 participants