[Numpy-discussion] Infinity as nan as real part
Wed Jun 25 14:05:31 CDT 2008
On Wed, Jun 25, 2008 at 07:42, Stéfan van der Walt <firstname.lastname@example.org> wrote:
> Hi all,
> Why can't a person construct a complex number with an infinite complex
> part and a zero real part?
> 1 + 1j*np.inf == (nan + infj) # because np.inf * 1j == (nan + infj)
In : from numpy import *
In : 1j == (0+1j)
In : 0*inf
> There is a workaround:
> z = np.array(, dtype=complex)
> z.imag = np.inf
> but that's not very pleasant.
In : complex(0, inf)
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion