that's not the key
import numpy
x=numpy.arange(0,1,.05)
y=numpy.sin(x)
still can't work

在 Tue, 17 Mar 2009 17:23:53 +0800,dagss <da...@student.matnat.uio.no>  
写道:

>
> On Mar 17, 10:09 am, peak <ggp...@gmail.com> wrote:
>> When I run below code in SageNB, it rised error:
>>
>> import numpy
>> x=numpy.arange(0,1,.05)
>> y=numpy.sin(2*pi*x)
>>
>> Traceback (click to the left for traceback)
>> ...
>> AttributeError: sin
>>
>> but the same code works well in python, how can I obtain array x & y
>> above except using [... for ... in range()] ?
>
> It's probably because "pi" is a Sage object while you are using a
> NumPy function. Use numpy.pi instead.
>
> (BTW it's a good idea to expand the traceback when you post an error,
> easier to figure out what is wrong then.)
>
> Dag Sverre
> >



-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to