In [1]:
import numpy as np

In [2]:
a_inf = np.array([-np.inf, 0, np.inf])
print(a_inf)


[-inf   0.  inf]

In [3]:
print(np.isinf(a_inf))


[ True False  True]

In [4]:
print(a_inf == np.inf)


[False False  True]

In [5]:
print(a_inf == -np.inf)


[ True False False]