![]() |
|
|
|||||||
![]() |
Python - Re: trouble with complex numbers |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
On Tue, Aug 4, 2009 at 11:28 PM, Dr. Phillip M.
Feldman<> wrote: > > When I try to compute the phase of a complex number, I get an error message: > > In [3]: from cmath import * > In [4]: x=1+1J > In [5]: phase(x) > <snip> > NameError: name 'phase' is not defined > <snip> > AttributeError: 'complex' object has no attribute 'phase' I suspect the problem lies in what you snipped away: In [1]: from cmath import phase In [2]: x=1+1J In [3]: phase(x) Out[3]: 0.78539816339744828 Cheers, Chris -- http://blog.rebertia.com Chris Rebert |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX: 2ND GIG (VOLUME 3) and more! | DVD Verdict | DVD Video | 0 | 03-09-2006 09:22 AM |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX: 2ND GIG (VOLUME 2) and more! | DVD Verdict | DVD Video | 0 | 01-19-2006 09:34 AM |
| Re: Numbers and more numbers... | Linda | A+ Certification | 1 | 12-03-2005 12:43 AM |
| Re: Numbers and more numbers... | Breedo | A+ Certification | 0 | 12-02-2005 12:45 AM |
| Re: Laptop won't type numbers | Adam Leinss | A+ Certification | 2 | 06-09-2005 04:00 AM |