Re: [Numpy-discussion] how to round to int (I mean 5.2 to 5 not 5.0)

2007-03-06 Thread Sebastian Haase
On 3/6/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On Tue, 6 Mar 2007, Sebastian Haase apparently wrote: > > why does > > numpy.round(a) > > return a float ? > > Because it works with a copy of a. > > >>> help(N.round) > Help on function round_ in module numpy.core.fromnumeric: > round_(a, decima

Re: [Numpy-discussion] how to round to int (I mean 5.2 to 5 not 5.0)

2007-03-06 Thread Alan G Isaac
On Tue, 6 Mar 2007, Sebastian Haase apparently wrote: > why does > numpy.round(a) > return a float ? Because it works with a copy of a. >>> help(N.round) Help on function round_ in module numpy.core.fromnumeric: round_(a, decimals=0, out=None) Returns reference to result. Copies a and rou

Re: [Numpy-discussion] how to round to int (I mean 5.2 to 5 not 5.0)

2007-03-06 Thread Robert Kern
Sebastian Haase wrote: > Hi, > why does > numpy.round(a) > return a float ? Partly because that's what the underlying C standard library function does and what the Python function round() does. The reason they do that is because the range of integers supported by the double precision floating poin

[Numpy-discussion] how to round to int (I mean 5.2 to 5 not 5.0)

2007-03-06 Thread Sebastian Haase
Hi, why does numpy.round(a) return a float ? I need something that I can use as indices for another array. Do I have to (implicitly) create a temporary array and use: N.round(a).astype(N.int) ? Or is there a simple, clean and easy way to just round [1.1 4.8] into [1 5] Thanks, Sebastian __

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-06 Thread Mark P. Miller
Charles R Harris wrote: > I won't comment on the code itself. Tell us what you want to do and I > bet we can speed it up. > Here's a bit of sample code. It's actually very useful for my purposes. Are there good ways to express these ideas in numpy as opposed to using all of the nested loop

Re: [Numpy-discussion] F2PY clarification of "so" file

2007-03-06 Thread Tyler J Hayes
Robert Kern gmail.com> writes: > Yes. > > No. > That was easy Thanks Robert, t. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion