[sage-devel] Re: numpy.mgrid problem

2008-09-29 Thread mabshoff
On Sep 29, 2:25 pm, gerhard <[EMAIL PROTECTED]> wrote: > The example I have trouble with is >     import numpy >     s,t=numpy.mgrid[-7.:7.:.05,-5.:5:.05] >     print type(s[0,1]) >     print s > Is this a bug? > > the explicit conversion to float suggested above does what I need. > > thanks, >

[sage-devel] Re: numpy.mgrid problem

2008-09-29 Thread gerhard
The example I have trouble with is import numpy s,t=numpy.mgrid[-7.:7.:.05,-5.:5:.05] print type(s[0,1]) print s Is this a bug? the explicit conversion to float suggested above does what I need. thanks, gerhard --~--~-~--~~~---~--~~ To post to thi

[sage-devel] Re: numpy.mgrid problem

2008-09-27 Thread Jason Grout
gerhard wrote: > I just noticed that from sage > x=numpy.mgrid[0.:1.:0.1] > coerces the results to integers. > > Is there a work-around? Using the Numpy 1.2 spkg that will probably be in the next version of Sage, I get: sage: import numpy sage: x=numpy.mgrid[0.:1.:0.1] sage: x array([0.0

[sage-devel] Re: numpy.mgrid problem

2008-09-27 Thread Mike Hansen
Hi Gerhard, On Sat, Sep 27, 2008 at 10:04 AM, gerhard <[EMAIL PROTECTED]> wrote: > > I just noticed that from sage > x=numpy.mgrid[0.:1.:0.1] > coerces the results to integers. > > Is there a work-around? > This is due to numpy not recognizing Sage's RealNumber class. sage: x=numpy.mgrid[0.:1.: