There is a function in numpy named np.isnan(A)
to check whether A is nan. In my case, A could be a number with some unknown value or np.nan
returned from another function. I need a function to tell me whether A is nan or some number. I don't care the value of the number but I need to know if it is nan or not. I tried to use !np.isnan(A)
but it's not a valid expression. Is there any function that can achieve this goal?
The structure of my code is like this:
if condition A and condition B:
do something...
I need condition A to be some function that can fulfill the purpose of !np.isnan(A)
.