On Tue, Aug 4, 2009 at 11: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: > > 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 -- http://mail.python.org/mailman/listinfo/python-list