SyntaxFix
Write A Post
Hire A Developer
Questions
Yes, you can use numpy for that.
numpy
import numpy as np a = arange(3,dtype=float) a[0] = np.nan a[1] = np.inf a[2] = -np.inf a # is now [nan,inf,-inf] np.isnan(a[0]) # True np.isinf(a[1]) # True np.isinf(a[2]) # True