You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/numpy/concepts/built-in-functions/terms/argmax/argmax.md
+3-5
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Returns an array of indices into the array. It has the same shape as the input a
37
37
38
38
## Example 1: Finding Maximum Element Position in a 1D Array
39
39
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:
41
41
42
42
```py
43
43
import numpy as np
@@ -65,7 +65,7 @@ The code identifies position 3 (zero-indexed) as containing the maximum temperat
65
65
66
66
## Example 2: Working with Multi-dimensional Arrays
67
67
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:
69
69
70
70
```py
71
71
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
109
109
110
110
## Example 3: [Machine Learning](https://www.codecademy.com/resources/docs/general/machine-learning) Applications with `keepdims`
111
111
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:
print(f"Top scorer in {subject}: Student {best_students[i] + 1}")
203
203
```
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