trouble with complex numbers

Discussion in 'Python' started by Dr. Phillip M. Feldman, Aug 5, 2009.

  1. 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-complex-numbers-tp24821423p24821423.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
     
    Dr. Phillip M. Feldman, Aug 5, 2009
    #1
    1. Advertising

  2. Dr. Phillip M. Feldman

    alex23 Guest

    On Aug 5, 4:28 pm, "Dr. Phillip M. Feldman" <>
    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, Aug 5, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.amnet.net.au
    Replies:
    1
    Views:
    581
    =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
    Apr 13, 2004
  2. oulan bator
    Replies:
    29
    Views:
    1,168
    Chris Uppal
    Dec 4, 2005
  3. Stanimir Stamenkov
    Replies:
    2
    Views:
    749
    Stanimir Stamenkov
    Oct 25, 2005
  4. Robert Mark Bram
    Replies:
    0
    Views:
    686
    Robert Mark Bram
    Feb 4, 2007
  5. Kottiyath

    How complex is complex?

    Kottiyath, Mar 18, 2009, in forum: Python
    Replies:
    22
    Views:
    769
Loading...

Share This Page