Re: [Numpy-discussion] Error importing numpy in cygwin

2011-04-12 Thread David Cournapeau
On Tue, Apr 12, 2011 at 10:25 AM, Gabriella Turek g.tu...@niwa.co.nz wrote: Hello I'm working with cygwin 1.7.9. I've installed python 2.6 from the cygwin distro. I've also installed nympy from the distro (v. 1.4.1), and when that failed, I tried to installed directly form source (v. 1.5.1)

Re: [Numpy-discussion] Extending numpy statistics functions (like mean)

2011-04-12 Thread Bruce Southey
On 04/11/2011 05:03 PM, Keith Goodman wrote: On Mon, Apr 11, 2011 at 2:36 PM, Sergio Pascualsergio.pa...@gmail.com wrote: Hi list. For mi application, I would like to implement some new statistics functions over numpy arrays, such as truncated mean. Ideally this new function should have

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Robert Kern
On Mon, Apr 11, 2011 at 23:43, Mark Wiebe mwwi...@gmail.com wrote: On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant oliph...@enthought.com wrote: It would be good to see a simple test case and understand why the boolean multiplied by the scalar double is becoming a float16.     In other

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 11:20, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern robert.k...@gmail.com wrote: On Mon, Apr 11, 2011 at 23:43, Mark Wiebe mwwi...@gmail.com wrote: On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant oliph...@enthought.com wrote:

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Mark Wiebe
On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern robert.k...@gmail.com wrote: On Tue, Apr 12, 2011 at 11:20, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern robert.k...@gmail.com wrote: On Mon, Apr 11, 2011 at 23:43, Mark Wiebe mwwi...@gmail.com wrote: On

Re: [Numpy-discussion] Error importing numpy in cygwin

2011-04-12 Thread Ralf Gommers
On Tue, Apr 12, 2011 at 9:17 AM, David Cournapeau courn...@gmail.com wrote: On Tue, Apr 12, 2011 at 10:25 AM, Gabriella Turek g.tu...@niwa.co.nz wrote: Hello I'm working with cygwin 1.7.9. I've installed python 2.6 from the cygwin distro. I've also installed nympy from the distro (v. 1.4.1),

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Charles R Harris
On Tue, Apr 12, 2011 at 10:49 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern robert.k...@gmail.comwrote: On Tue, Apr 12, 2011 at 11:20, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern robert.k...@gmail.com wrote: On

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Charles R Harris
On Tue, Apr 12, 2011 at 10:20 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern robert.k...@gmail.comwrote: On Mon, Apr 11, 2011 at 23:43, Mark Wiebe mwwi...@gmail.com wrote: On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant oliph...@enthought.com wrote:

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 12:27, Charles R Harris charlesr.har...@gmail.com wrote: IIRC, the behavior with respect to scalars sort of happened in the code on the fly, so this is a good discussion to have. We should end up with documented rules and tests to enforce them. I agree with Mark that

[Numpy-discussion] f2py pass by reference

2011-04-12 Thread Mathew Yeates
I have subroutine foo (a) integer a print*, Hello from Fortran! print*, a=,a a=2 end and from python I want to do a=1 foo(a) and I want a's value to now be 2. How do I do this? Mathew ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Charles R Harris
On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern robert.k...@gmail.com wrote: On Tue, Apr 12, 2011 at 12:27, Charles R Harris charlesr.har...@gmail.com wrote: IIRC, the behavior with respect to scalars sort of happened in the code on the fly, so this is a good discussion to have. We should

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Sameer Grover
On 12/04/11 23:36, Mathew Yeates wrote: I have subroutine foo (a) integer a print*, Hello from Fortran! print*, a=,a a=2 end and from python I want to do a=1 foo(a) and I want a's value to now be 2. How do I do this? Mathew

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Pearu Peterson
On Tue, Apr 12, 2011 at 9:06 PM, Mathew Yeates mat.yea...@gmail.com wrote: I have subroutine foo (a) integer a print*, Hello from Fortran! print*, a=,a a=2 end and from python I want to do a=1 foo(a) and I want a's value to now be 2. How do I do this?

[Numpy-discussion] Data standardizing

2011-04-12 Thread Climate Research
Hi I am purely new to python and numpy.. I am using python for doing statistical calculations to Climate data.. I have a data set in the following format.. Year Jan feb MarApr. Dec 1900 10001001 ,, , 1901 1011

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Mark Wiebe
On Tue, Apr 12, 2011 at 11:17 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern robert.k...@gmail.comwrote: On Tue, Apr 12, 2011 at 12:27, Charles R Harris charlesr.har...@gmail.com wrote: IIRC, the behavior with respect to scalars sort

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Mathew Yeates
bizarre I get = hello.foo(a) Hello from Fortran! a= 1 2 a 1 hello.foo(a) Hello from Fortran! a= 1 2 print a 1 = i.e. The value of 2 gets printed! This is numpy 1.3.0 -Mathew On Tue, Apr 12, 2011 at 11:45 AM, Pearu Peterson

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Pearu Peterson
Note that hello.foo(a) returns the value of Fortran `a` value. This explains the printed 2 value. So, use a = hello.foo(a) and not hello.foo(a) As Sameer noted in previous mail, passing Python scalar values to Fortran by reference is not possible because Python scalars are immutable. Hence

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 11:49, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern robert.k...@gmail.com wrote: You're missing the key part of the rule that numpy uses: for array*scalar cases, when both array and scalar are the same kind (both floating point or

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 13:17, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern robert.k...@gmail.com wrote: On Tue, Apr 12, 2011 at 12:27, Charles R Harris charlesr.har...@gmail.com wrote: IIRC, the behavior with respect to scalars sort of