real and imaginary part from python complex numbers 
Author Message
 real and imaginary part from python complex numbers

Hello,

Please help me, how do I get real and imaginary part from python
complex numbers?

Cheers

Berthold
--

   )
  (
C[_]  These opinions might be mine, but never those of my employer.



Mon, 24 Apr 2000 03:00:00 GMT  
 real and imaginary part from python complex numbers



Quote:
> Hello,

> Please help me, how do I get real and imaginary part from python
> complex numbers?

spam = 1+1j
baked_beans = spam.real
eggs = spam.imag

should do the trick.

--
____
  /im



Mon, 24 Apr 2000 03:00:00 GMT  
 real and imaginary part from python complex numbers

Quote:

> >Please help me, how do I get real and imaginary part from python
> >complex numbers?

> >>> a = 1j
> >>> a.real
> 0.0
> >>> a.imag
> 1.0

> Cheers /F

Yes, thank's alot, but where have I overseen the documentation
om this? It (definitly) has not found its way into my version
of the python1.4 online library documentation.

Cheers
Berhold
--

   )
  (
C[_]  These opinions might be mine, but never those of my employer.



Mon, 24 Apr 2000 03:00:00 GMT  
 real and imaginary part from python complex numbers

Quote:
> Yes, thank's alot, but where have I overseen the documentation
> om this? It (definitly) has not found its way into my version
> of the python1.4 online library documentation.

It's described in the "language changes" section in the tutorial...

(IIRC, that's fixed in the 1.5 docs)

Cheers /F

http://www.pythonware.com



Mon, 24 Apr 2000 03:00:00 GMT  
 real and imaginary part from python complex numbers

Quote:
>Please help me, how do I get real and imaginary part from python
>complex numbers?
>>> a = 1j
>>> a.real  
0.0
>>> a.imag

1.0

Cheers /F



Mon, 24 Apr 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. identify real and imaginary part of complex

2. how can I make imaginary number with known real number

3. How to extract the real part of a complex number in f77

4. Complex/Imaginary numbers

5. A logicial to Pass complex number to real number

6. passing only the real parts of a complex array to a function

7. extracting real/imag part from complex*16

8. Complex trig functions for large imaginary arguments

9. program to separate the real and imaginary

10. Break real number into sign, fractional, and exponet parts

11. intrinsic function for the imaginary part and conjugate?

12. Python Packages for Complex Numbers and Matrix Math

 

 
Powered by phpBB® Forum Software