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 wrote: > > > On Fri, May 1, 2009 at 7:24 PM, Neal Becker wrote: > >> Charles R Harris wrote: >> >> > On Fri, May 1, 2009 at 1:02 PM, Neal Becker >> wrote: >> > >> >> In [16]: (np.linspace (0, len (x)-1, len(x)).astype >> (np.uint64)*2).dtype >> >>

Re: [Numpy-discussion] Really strange result

2009-05-01 Thread Charles R Harris
On Fri, May 1, 2009 at 7:24 PM, Neal Becker wrote: > Charles R Harris wrote: > > > On Fri, May 1, 2009 at 1:02 PM, Neal Becker 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

Re: [Numpy-discussion] Really strange result

2009-05-01 Thread Neal Becker
Charles R Harris wrote: > On Fri, May 1, 2009 at 1:02 PM, Neal Becker 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') >> >>

Re: [Numpy-discussion] Really strange result

2009-05-01 Thread Charles R Harris
On Fri, May 1, 2009 at 1:02 PM, Neal Becker 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) > Out[18]: > > No

[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]: Now that's just strange. What's going on? __

[Numpy-discussion] apply table lookup to each element

2009-05-01 Thread Neal Becker
Suggestion for efficient way to apply a table lookup to each element of an integer array? import numpy as np _cos = np.empty ((2**rom_in_bits,), dtype=int) _sin = np.empty ((2**rom_in_bits,), dtype=int) for address in xrange (2**12): _cos[address] = nint ((2.0**(rom_out_bits-1)-1) * cos (2 *