np.max is just an alias for np.amax. This function only works on a single input array and finds the value of maximum element in that entire array (returning a scalar). Alternatively, it takes an axis argument and will find the maximum value along an axis of the input array (returning a new array).

>>> a = np.array([[0, 1, 6],
                  [2, 4, 1]])
>>> np.max(a)
6
>>> np.max(a, axis=0) # max of each column
array([2, 4, 6])

The default behaviour of np.maximum is to take two arrays and compute their element-wise maximum. Here, 'compatible' means that one array can be broadcast to the other. For example:

>>> b = np.array([3, 6, 1])
>>> c = np.array([4, 2, 9])
>>> np.maximum(b, c)
array([4, 6, 9])

But np.maximum is also a universal function which means that it has other features and methods which come in useful when working with multidimensional arrays. For example you can compute the cumulative maximum over an array (or a particular axis of the array):

>>> d = np.array([2, 0, 3, -4, -2, 7, 9])
>>> np.maximum.accumulate(d)
array([2, 2, 3, 3, 3, 7, 9])

This is not possible with np.max.

You can make np.maximum imitate np.max to a certain extent when using np.maximum.reduce:

>>> np.maximum.reduce(d)
9
>>> np.max(d)
9

Basic testing suggests the two approaches are comparable in performance; and they should be, as np.max() actually calls np.maximum.reduce to do the computation.

Answer from Alex Riley on Stack Overflow
Top answer
1 of 4
260

np.max is just an alias for np.amax. This function only works on a single input array and finds the value of maximum element in that entire array (returning a scalar). Alternatively, it takes an axis argument and will find the maximum value along an axis of the input array (returning a new array).

>>> a = np.array([[0, 1, 6],
                  [2, 4, 1]])
>>> np.max(a)
6
>>> np.max(a, axis=0) # max of each column
array([2, 4, 6])

The default behaviour of np.maximum is to take two arrays and compute their element-wise maximum. Here, 'compatible' means that one array can be broadcast to the other. For example:

>>> b = np.array([3, 6, 1])
>>> c = np.array([4, 2, 9])
>>> np.maximum(b, c)
array([4, 6, 9])

But np.maximum is also a universal function which means that it has other features and methods which come in useful when working with multidimensional arrays. For example you can compute the cumulative maximum over an array (or a particular axis of the array):

>>> d = np.array([2, 0, 3, -4, -2, 7, 9])
>>> np.maximum.accumulate(d)
array([2, 2, 3, 3, 3, 7, 9])

This is not possible with np.max.

You can make np.maximum imitate np.max to a certain extent when using np.maximum.reduce:

>>> np.maximum.reduce(d)
9
>>> np.max(d)
9

Basic testing suggests the two approaches are comparable in performance; and they should be, as np.max() actually calls np.maximum.reduce to do the computation.

2 of 4
26

You've already stated why np.maximum is different - it returns an array that is the element-wise maximum between two arrays.

As for np.amax and np.max: they both call the same function - np.max is just an alias for np.amax, and they compute the maximum of all elements in an array, or along an axis of an array.

In [1]: import numpy as np

In [2]: np.amax
Out[2]: <function numpy.core.fromnumeric.amax>

In [3]: np.max
Out[3]: <function numpy.core.fromnumeric.amax>
Discussions

python - numpy.max or max ? Which one is faster? - Stack Overflow
Well from my timings it follows if you already have numpy array a you should use a.max (the source tells it's the same as np.max if a.max available). More on stackoverflow.com
🌐 stackoverflow.com
python - Difference between max and np.max - Stack Overflow
I have a question on the difference between just using max(list array) and np.max(list array). Is the only difference here the time it takes for Python to return the code? More on stackoverflow.com
🌐 stackoverflow.com
How does np.max differ from np.amax and np.maximum, and why does NumPy include all three? - TestMu AI Community
Greetings folks! :wave: I’ve been diving deeper into NumPy’s functions lately, trying to get a clearer picture of their intended uses and performance nuances. It’s always fascinating to uncover the design decisions behin… More on community.testmu.ai
🌐 community.testmu.ai
0
June 13, 2025
How specifically is the numpy max function so fast?
NumPy has SIMD intrinsic and code to vectorise simple loops. It tries very hard to do simple things as fast as possible on your platform. The typical std routines are not as optimised/optimizable More on reddit.com
🌐 r/Numpy
2
2
March 5, 2025
🌐
Real Python
realpython.com › numpy-max-maximum
NumPy's max() and maximum(): Find Extreme Values in Arrays – Real Python
October 22, 2025 - NumPy’s max() function finds the maximum value within a single array, working with both one-dimensional and multi-dimensional arrays. Conversely, np.maximum() compares two arrays element-wise to find the maximum values.
🌐
Codecademy
codecademy.com › docs › python:numpy › built-in functions › .max()
Python:NumPy | Built-in Functions | .max() | Codecademy
July 2, 2025 - This enables broadcasting operations like normalization, where each temperature reading is divided by the maximum temperature of its respective sensor. np.max() finds the maximum value within a single array or along specified axes, while np.maxi...
🌐
Cmu
jitsi.cmu.edu.jm › home › 9+ numpy max: np.max vs np.maximum explained!
9+ NumPy Max: np.max vs np.maximum Explained!
March 28, 2025 - The preceding exploration elucidated the critical differences between `np.max` and `np.maximum` in numerical computing with NumPy. One represents an array reduction, yielding the maximum value (or an array of maximums along a specified axis), while the other conducts element-wise comparisons, producing a new array of maxima.
🌐
Codegive
codegive.com › blog › numpy_max_vs_maximum.php
Numpy max vs maximum
numpy.max (and np.amax): A reduction operation. It finds the single largest value (or largest values along an axis) within a single array. It takes one array as its primary input. numpy.maximum: An element-wise comparison operation (a universal function or ufunc).
🌐
IncludeHelp
includehelp.com › python › numpy-max-or-max-which-one-is-faster.aspx
Python - numpy.max() or max(), which one is faster?
December 25, 2023 - If we have a numpy array, we should use numpy.max() but if we have a built-in list then most of the time takes converting it into numpy.ndarray hence, we must use arr/list.max().
Find elsewhere
🌐
YouTube
youtube.com › the python oracle
numpy max vs amax vs maximum - YouTube
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn--Music by Eric Matyashttps://www.soundimage.orgTrack title: Techno I
Published: March 15, 2023
Views: 43
🌐
Codemia
codemia.io › home › knowledge hub › numpy max vs amax vs maximum
numpy max vs amax vs maximum | Codemia
September 24, 2025 - Use axis with np.max or np.amax for row-wise or column-wise results. Use np.maximum when you want pairwise maxima, not a single reduced result.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.max.html
numpy.max — NumPy v2.2 Manual
Notice that the initial value is used as one of the elements for which the maximum is determined, unlike for the default argument Python’s max function, which is only used for empty iterables. >>> np.max([5], initial=6) 6 >>> max([5], default=6) 5
🌐
Sharp Sight
sharpsight.ai › blog › numpy-maximum
How to Use the Numpy Maximum Function - Sharp Sight
March 1, 2022 - So np.maximum will typically take two Numpy arrays as an input, and will return an array with the element-wise maximum for each pair of values. (Although, there are some additional ways to use it, which I’ll cover in a moment.) This is an important distinction to make. np.max and np.maximum work differently, so make sure you use the right one.
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.max.html
numpy.max — NumPy v2.6.dev0 Manual
Notice that the initial value is used as one of the elements for which the maximum is determined, unlike for the default argument Python’s max function, which is only used for empty iterables. >>> np.max([5], initial=6) 6 >>> max([5], default=6) 5
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.maximum.html
numpy.maximum — NumPy v2.5 Manual
The maximum is equivalent to np.where(x1 >= x2, x1, x2) when neither x1 nor x2 are nans, but it is faster and does proper broadcasting.
🌐
NumPy
numpy.org › doc › 2.4 › reference › generated › numpy.max.html
numpy.max — NumPy v2.4 Manual
Notice that the initial value is used as one of the elements for which the maximum is determined, unlike for the default argument Python’s max function, which is only used for empty iterables. >>> np.max([5], initial=6) 6 >>> max([5], default=6) 5
🌐
Testmu
community.testmu.ai › t › how-does-np-max-differ-from-np-amax-and-np-maximum-and-why-does-numpy-include-all-three › 37813
How does np.max differ from np.amax and np.maximum, and why does NumPy include all three? - TestMu AI Community
June 13, 2025 - Greetings folks! 👋 I’ve been diving deeper into NumPy’s functions lately, trying to get a clearer picture of their intended uses and performance nuances. It’s always fascinating to uncover the design decisions behind such powerful libraries. I’ve come across an interesting trio of functions, np.max, np.amax, and np.maximum, and their specific roles have sparked some curiosity.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.max.html
numpy.max — NumPy v2.5 Manual
Notice that the initial value is used as one of the elements for which the maximum is determined, unlike for the default argument Python’s max function, which is only used for empty iterables. >>> np.max([5], initial=6) 6 >>> max([5], default=6) 5
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.maximum.html
numpy.maximum — NumPy v2.2 Manual
The maximum is equivalent to np.where(x1 >= x2, x1, x2) when neither x1 nor x2 are nans, but it is faster and does proper broadcasting.
🌐
Educative
educative.io › answers › what-is-numpymaximum-in-python
What is numpy.maximum() in Python?
A universal function (ufunc) is a function that operates on ndarrays in an element-by-element fashion. The maximum() method is a universal function.