Well from my timings it follows if you already have numpy array a
you should use a.max
(the source tells it's the same as np.max
if a.max
available). But if you have built-in list then most of the time takes converting it into np.ndarray => that's why max
is better in your timings.
In essense: if np.ndarray
then a.max
, if list
and no need for all the machinery of np.ndarray
then standard max
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…