[Numpy-discussion] complex numbers

Kenny Ortmann kortmann at ideaworks.com
Tue Oct 3 15:01:48 CDT 2006

excuse my laziness for not looking this up, I googled it but could not find 
a solution.
matlab has a
where if the array is full of real numbers the value returned is 1.
I'm translating matlab code and ran across

if ~isreal(array)
    array = abs(array)

Is there a way to check to see if a number is real or complex? and if so is 
there a way to extract the(a + ib) because the absolute value of a complex 
number is like the pythagorean therom on a and b?

thanks for your help,

More information about the Numpy-discussion mailing list