Go Back   Velocity Reviews > Newsgroups > Python
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Python - trouble with complex numbers

 
Thread Tools Search this Thread
Old 08-05-2009, 07:28 AM   #1
Default trouble with complex numbers



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'

Any advice will be appreciated.
--
View this message in context: http://www.nabble.com/trouble-with-c...p24821423.html
Sent from the Python - python-list mailing list archive at Nabble.com.



Dr. Phillip M. Feldman
  Reply With Quote
Old 08-05-2009, 09:43 AM   #2
alex23
 
Posts: n/a
Default Re: trouble with complex numbers
On Aug 5, 4:28*pm, "Dr. Phillip M. Feldman" <pfeld...@verizon.net>
wrote:
> When I try to compute the phase of a complex number, I get an error message:
> [...]
> Any advice will be appreciated.


1. What version of Python are you using, and on what platform?

2. What you snipped is necessary to help debug your problem.

3. Do you have a cmath.py in the folder you're running the interpreter
in?



alex23
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46