Re: [Numpy-discussion] Really strange result

2009-05-04 Thread Bruce Southey
Neal Becker wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 7:39 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Fri, May 1, 2009 at 7:24 PM, Neal Becker ndbeck...@gmail.com wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 1:02 PM, Neal

Re: [Numpy-discussion] Really strange result

2009-05-04 Thread Christopher Barker
Neal Becker wrote: In [3]: n=-7 In [4]: (np.linspace (0, 1023,1024).astype(np.uint64)*n).dtype Out[4]: dtype('float64') what would you like (expect) to happen when you multiply an unsigned type by a negative number? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response

Re: [Numpy-discussion] Really strange result

2009-05-02 Thread Neal Becker
Charles R Harris wrote: On Fri, May 1, 2009 at 7:39 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Fri, May 1, 2009 at 7:24 PM, Neal Becker ndbeck...@gmail.com wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 1:02 PM, Neal Becker ndbeck...@gmail.com wrote: In [16]:

[Numpy-discussion] Really strange result

2009-05-01 Thread Neal Becker
In [16]: (np.linspace (0, len (x)-1, len(x)).astype (np.uint64)*2).dtype Out[16]: dtype('uint64') In [17]: (np.linspace (0, len (x)-1, len(x)).astype (np.uint64)*n).dtype Out[17]: dtype('float64') In [18]: type(n) Out[18]: type 'int' Now that's just strange. What's going on?

Re: [Numpy-discussion] Really strange result

2009-05-01 Thread Charles R Harris
On Fri, May 1, 2009 at 1:02 PM, Neal Becker ndbeck...@gmail.com wrote: In [16]: (np.linspace (0, len (x)-1, len(x)).astype (np.uint64)*2).dtype Out[16]: dtype('uint64') In [17]: (np.linspace (0, len (x)-1, len(x)).astype (np.uint64)*n).dtype Out[17]: dtype('float64') In [18]: type(n)

Re: [Numpy-discussion] Really strange result

2009-05-01 Thread Charles R Harris
On Fri, May 1, 2009 at 7:24 PM, Neal Becker ndbeck...@gmail.com wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 1:02 PM, Neal Becker ndbeck...@gmail.com wrote: In [16]: (np.linspace (0, len (x)-1, len(x)).astype (np.uint64)*2).dtype Out[16]: dtype('uint64') In [17]:

Re: [Numpy-discussion] Really strange result

2009-05-01 Thread Charles R Harris
On Fri, May 1, 2009 at 7:39 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Fri, May 1, 2009 at 7:24 PM, Neal Becker ndbeck...@gmail.com wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 1:02 PM, Neal Becker ndbeck...@gmail.com wrote: In [16]: (np.linspace (0, len (x)-1,