I had like to know the best fatest/optimized way of getting the maximum values element-wised of "n" matrices in Python/Numpy.
For example:
import numpy as np
matrices=[np.random.random((5,5)) for i in range(10)]
# the function np.maximum from numpy only works for two matrices.
max_matrix=np.maximum(matrices[0],matrices[1])
max_matrix=np.maximum(*matrices) # <- error
How would you overcome this problem?
Use
reduce:From the docs: