I'm using the following code to search for the maximum of pred_flat. Is there a direct way to find the second maximum?
line_max_flat = np.max(pred_flat, axis=1) ##creates an array with 2500 entries, each containing the max of the row
The variable pred_flat is an array of size (2500,5) and the other questions regarding the second maximum only address arrays with 1 column or lists.
EDIT: An example of the input is:
pred_flat=[[0.1,0.2,0.3,0.5,0.7]
[0.5.0.4,0.9,0.7,0.3]
[0.9,0.7,0.8,0.4,0.1]]
and the output should be:
line_max_flat=[0.5,0.7,0.8]
np.min) since you have 2 value per line...