I have an array with 4 randomly generated elements (using Python):
pa = np.random.normal(10, 5, 4)
I can find the largest element by doing:
ml = np.max(pa)
mll = np.where(pa == ml)
print(mll)
I'm wondering how can I find the 2nd and 3rd elements in this array? Also, my current output looks like:
(array([0]),)
Is there a way I can get a pure numerical output (0)? Thanks!
Update: Sorry for the previous confusion, I want to find the index of the 2nd and 3rd largest element, but all the answers so far are very helpful to me. Thanks!!