0

Is there a way to find out the highest individual numbers give a list of Numpy arrays?

e.g.

import numpy as np
a = np.array([10, 2])
b = np.array([3, 4])
c = np.array([5, 6])

The output will be a Numpy array with the following form:

np.array([10, 6])
2
  • Are the arrays all of the same shape? Commented Oct 8, 2019 at 13:09
  • yes. they are in same shape Commented Oct 8, 2019 at 13:10

1 Answer 1

2

You can stack all arrays together and get the max afterwards:

np.stack((a, b, c)).max(0)
# array([10,  6])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.