[Numpy-discussion] isposinf returns array, isinf doesn't

josef.pktd at gmail.com josef.pktd at gmail.com
Fri Jan 14 15:33:03 EST 2011


maybe just cosmetic, I just found this

>>> stats.poisson.b
1.#INF

>>> np.isinf(stats.poisson.b)
True
>>> np.isinf(-stats.poisson.b)
True
>>> np.isposinf(stats.poisson.b)
array(True, dtype=bool)
>>> np.isneginf(stats.poisson.b)
array(False, dtype=bool)
>>> np.isneginf(-stats.poisson.b)
array(True, dtype=bool)

but shape is the same
>>> np.isneginf(stats.poisson.b).shape
()
>>> np.isinf(stats.poisson.b).shape
()

>>> type(np.isneginf(stats.poisson.b))
<type 'numpy.ndarray'>
>>> type(np.isinf(stats.poisson.b))
<type 'numpy.bool_'>

Josef



More information about the NumPy-Discussion mailing list