[sage-devel] Re: some functions seems not work as in numpy

2009-03-17 Thread Guan Guofeng
thanks uncompatible types and poor error prompt really make me confused 在 Tue, 17 Mar 2009 22:19:07 +0800,Jason Grout 写道: > > dagss wrote: >> On Mar 17, 10:40 am, "Guan Guofeng" wrote: >>> that's not the key >>> import numpy >>> x=numpy.arange(0,1,.05) >>> y=numpy.sin(x) >>> still can't work

[sage-devel] Re: some functions seems not work as in numpy

2009-03-17 Thread Jason Grout
dagss wrote: > On Mar 17, 10:40 am, "Guan Guofeng" wrote: >> that's not the key >> import numpy >> x=numpy.arange(0,1,.05) >> y=numpy.sin(x) >> still can't work > > Ahh right. NumPy is not compatible with the Sage number types. Either > specify "%python" at the top of the cell, or do > > sage:

[sage-devel] Re: some functions seems not work as in numpy

2009-03-17 Thread dagss
On Mar 17, 10:40 am, "Guan Guofeng" wrote: > that's not the key > import numpy > x=numpy.arange(0,1,.05) > y=numpy.sin(x) > still can't work Ahh right. NumPy is not compatible with the Sage number types. Either specify "%python" at the top of the cell, or do sage: import numpy sage: Integer = i

[sage-devel] Re: some functions seems not work as in numpy

2009-03-17 Thread Guan Guofeng
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 写道: > > On Mar 17, 10:09 am, peak 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) >>

[sage-devel] Re: some functions seems not work as in numpy

2009-03-17 Thread dagss
On Mar 17, 10:09 am, peak 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