Everything is fine when you work with float values.
>>> import numpy as np
>>> np.max(1.2, np.nan)
>>> nan
But when working with decimal values โโ...
>>> import numpy as np
>>> import decimal as d
>>> np.max([d.Decimal('1.2'), d.Decimal('NaN')])
>>> InvalidOperation: comparison involving NaN
Is there a way to get decimal values โโwith NaN to play nicely?
Note:
source
share