📅  最后修改于: 2022-03-11 14:45:29.210000             🧑  作者: Mango
>>> import numpy as np
>>> np.max(np.nonzero([-2, -2, 0, 0, 0, 0, 0]))
1 # at index 1
>>> np.max(np.nonzero([-2, 20, -1, 0, 3, 0, 0]))
4 # at index 4