I have learnt inf from: How can I represent an infinite number in Python?
I wish to find the minimum value of an array with 'inf' included
In [330]: residuals
Out[330]:
array([[ 2272.35651718, 1387.71126686, 1115.48728484],
[ 695.08009848, inf, inf],
[ 601.44997093, inf, inf]])
In [331]: min(residuals)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-331-69b09e4201cf> in <module>()
----> 1 min(residuals)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
However it seems like 'inf' is ambiguous? Is there a smart way to find the minimum value rather than run a loop on every value of this array?