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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---