You can use np.ufunc.reduce with multiple axis to get as array as you want.

(first find max on axis=1 from X1 , X2 then find max on axis=0 from result.)

np.maximum.reduce([X1, X2], axis=(1,0))
# array([4633.70349825])

np.minimum.reduce([X1, X2], axis=(1,0))
# array([319.09009796])

Or try this to get as value:

>>> np.max((X1,X2))
4633.70349825

>>> np.min((X1,X2))
319.09009796

Or try this to get as array:

>>> max(max(X1), max(X2))
array([4633.70349825])

>>> min(min(X1), min(X2))
array([319.09009796])
Answer from Mahdi F. on Stack Overflow
Discussions

numpy - Maximum and Minimum values from multiple arrays in Python - Stack Overflow
I have two arrays X1 and X2. I want to find maximum and minimum values from these two arrays in one step. But it runs into an error. I present the expected output. import numpy as np X1 = np.array... More on stackoverflow.com
🌐 stackoverflow.com
python - Element-wise array maximum function in NumPy (more than two arrays) - Stack Overflow
I want the resulting array to be array([3,1,4]). I wanted to use numpy.maximum, but it is only good for two arrays. More on stackoverflow.com
🌐 stackoverflow.com
find mean of 2 numpy arrays without using the 0 values
I'd set 0 values to nan and then use np.nanmean More on reddit.com
🌐 r/learnpython
18
3
April 9, 2023
Calculate max envelope function
This result is obtained by these functions. def interpolateZeros(x, y): # replace zeros with interpolation numpy # http://stackoverflow.com/questions/20896100/interpolation-ignoring-zero-values-in-array-python indice, = y.nonzero() start, stop = indice[0], indice[-1] + 1 f = interp1d(x[indice], y[indice]) y[start:stop] = f(x[start:stop]) return y def high_envelope(y_values, half_window_size): # Special thanks to: P. Ideler stack = np.append([0] * (half_window_size * 2), y_values) # Shift array a few places en stack them on each other resulting in an matrix/array for i in range(-half_window_size + 1, half_window_size + 1): # vstack = Stack arrays in sequence vertically (row wise) stack = np.vstack( (stack, np.append(np.append([0] * (half_window_size - i), y_values), [0] * (half_window_size + i)))) # Calculate vertical maxima of matrix return np.amax(stack, axis=0)[half_window_size:-half_window_size] def envelopeRelMax(xVal, yVal): # Use the relative maxima to calculate an high envelope relmaxindeces, = argrelmax(yVal) y_max_interpolated = np.interp(xVal, xVal[relmaxindeces], yVal[relmaxindeces]) return y_max_interpolated def smoothCurve(xVals, yVals, how_many_points=50): x_smooth = np.linspace(xVals.min(), xVals.max(), how_many_points) # y_smooth = spline(my_data['time'], y_max_interpolated, x_smooth) # Doesn't work for some reason, the line below does y_smooth = sp.interpolate.interp1d(xVals, yVals, kind='cubic')(x_smooth) return x_smooth, y_smooth def smoothViaInterpolate(xVals, yVals, how_many_points=100): # same functionality, other implementation as smoothCurve # http://scipy-cookbook.readthedocs.org/items/RadialBasisFunctions.html#d-example # use fitpack2 method xi = np.linspace(xVals.min(), xVals.max(), how_many_points) ius = InterpolatedUnivariateSpline(xVals, yVals) yi = ius(xi) return xi, yi Interpolate zeros envelopeRelMax smoothViaInterpolate or high_envelope More on reddit.com
🌐 r/scipy
1
2
April 16, 2016
🌐
Programiz
programiz.com › python-programming › numpy › methods › maximum
NumPy maximum() (With Examples)
The maximum() function is used to find the maximum value between the corresponding elements of two arrays. import numpy as np array1 = np.array([1, 2, 3, 4, 5]) array2 = np.array([2, 4, 1, 5, 3])
🌐
Vultr Docs
docs.vultr.com › python › third party › numpy › maximum()
Python Numpy maximum() - Find Maximum Value
November 18, 2024 - Use numpy.maximum() to compare two arrays element-wise and find the maximum value of each position.
🌐
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.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.maximum.html
numpy.maximum — NumPy v2.2 Manual
Element-wise maximum of array elements. Compare two arrays and return a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then that element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for ...
🌐
GeeksforGeeks
geeksforgeeks.org › numpy-maximum-in-python
numpy.maximum() in Python - GeeksforGeeks
November 28, 2018 - numpy.maximum() function is used to find the element-wise maximum of array elements. It compares two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then that element is returned.
🌐
Codegive
codegive.com › blog › numpy_max_between_two_arrays.php
Numpy max between two arrays
The numpy.maximum(x1, x2, /[, out, where, casting, order, ...]) function computes the element-wise maximum of array elements between x1 and x2.
Find elsewhere
🌐
Moonbooks
en.moonbooks.org › Articles › How-to-only-keep-the-maximum-value-element-wise-when-comparing-two-numpy-arrays-
How to only keep the maximum value of two numpy arrays ?
December 8, 2023 - One way to only keep the maximum value element-wise is to use the np.maximum() function. This function takes two arrays as input and returns a new array with the maximum value at each element-wise index.
🌐
Sharp Sight
sharpsight.ai › blog › numpy-maximum
How to Use the Numpy Maximum Function - Sharp Sight
March 1, 2022 - So np.max typically takes a single Numpy array as an input, and will return the maximum value (although there are ways to use it where it will return maxima of the rows or columns). In contrast, Numpy maximum (which we’re discussing in this tutorial) computes the element-wise maximum of two arrays.
🌐
TutorialsPoint
tutorialspoint.com › article › compare-two-arrays-and-return-the-element-wise-maximum-in-numpy
Compare two arrays and return the element-wise maximum in Numpy
February 7, 2022 - To compare two arrays and return the element-wise maximum, use the numpy.maximum() method in Python Numpy. Return value is either True or False. Returns the maximum of x1 and x2, element-wise.
🌐
Medium
medium.com › @amit25173 › understanding-element-wise-maximum-in-numpy-43916b1c2002
Understanding Element-wise Maximum in NumPy | by Amit Yadav | Medium
March 6, 2025 - When working with arrays, there are many times when you need to compare elements one by one and pick the maximum value at each position. That’s where NumPy’s maximum() function comes into play. It efficiently finds the element-wise max between ...
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.maximum.html
numpy.maximum — NumPy v2.1 Manual
Element-wise maximum of array elements. Compare two arrays and return a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then that element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for ...
🌐
JAX Documentation
docs.jax.dev › en › latest › _autosummary › jax.numpy.maximum.html
jax.numpy.maximum - JAX documentation - Read the Docs
>>> nan = jnp.nan >>> x2 = jnp.array([nan, -3, 9]) >>> y2 = jnp.array([[4, -2, nan], ... [-3, -5, 10]]) >>> jnp.maximum(x2, y2) Array([[nan, -2., nan], [nan, -3., 10.]], dtype=float32)
🌐
Codegive
codegive.com › blog › numpy_max_of_two_arrays.php
Numpy max of two arrays
Unlike the np.max (or .max() method) which finds the largest value within a single array (or along an axis), np.maximum performs a pairwise comparison between two arrays (or an array and a scalar), returning a new array containing the larger of the corresponding elements.
🌐
SciPy
docs.scipy.org › doc › › numpy-1.15.1 › reference › generated › numpy.maximum.html
numpy.maximum — NumPy v1.15 Manual
numpy.maximum(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'maximum'>¶ · Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.
🌐
Educative
educative.io › answers › what-is-numpymaximum-in-python
What is numpy.maximum() in Python?
Python’s numpy.maximum() computes the element-wise maximum of an array. It compares two arrays and returns a new array containing the maximum values.
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › how to calculate maximum of array in numpy
How to Calculate Maximum of Array in NumPy - Spark By {Examples}
September 24, 2024 - Python NumPy maximum() or max() function is used to get the maximum value (greatest value) of a given array, or compare the two arrays