Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe532d8

Browse files
authoredApr 4, 2025··
Update argmax.md
1 parent 0a34c4f commit fe532d8

File tree

1 file changed

+3
-5
lines changed
  • content/numpy/concepts/built-in-functions/terms/argmax

1 file changed

+3
-5
lines changed
 

‎content/numpy/concepts/built-in-functions/terms/argmax/argmax.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Returns an array of indices into the array. It has the same shape as the input a
3737

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

40-
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:
40+
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, as illustrated in the following example:
4141

4242
```py
4343
import numpy as np
@@ -65,7 +65,7 @@ The code identifies position 3 (zero-indexed) as containing the maximum temperat
6565

6666
## Example 2: Working with Multi-dimensional Arrays
6767

68-
`.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:
68+
`.argmax()` becomes especially powerful when working with multi-dimensional arrays. By specifying the axis parameter, maximum values along rows or columns can be found, making it useful for tasks like identifying the highest value in each feature of a dataset, as demonstrated here:
6969

7070
```py
7171
import numpy as np
@@ -109,7 +109,7 @@ The results tell us that Product A performs best in Q2, Product B in Q4, and Pro
109109

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

112-
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:
112+
The `.argmax()` function is commonly used in machine learning to identify predicted classes from probability outputs. The `keepdims` parameter parameter helps maintain the original dimensions, making it easier to integrate into larger computational graphs, as shown in this case:
113113

114114
```py
115115
import numpy as np
@@ -201,5 +201,3 @@ subjects = ["Math", "Science", "English"]
201201
for i, subject in enumerate(subjects):
202202
print(f"Top scorer in {subject}: Student {best_students[i] + 1}")
203203
```
204-
205-
Explore the [Learn Statistics with NumPy](https://www.codecademy.com/enrolled/courses/intro-statistics-numpy) course on Codecademy to delve deeper into NumPy functionalities.

0 commit comments

Comments
 (0)
Please sign in to comment.