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 wrote: > > > On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern wrote: >> >> On Tue, Apr 12, 2011 at 12:27, Charles R Harris >> wrote: >> >> > IIRC, the behavior with respect to scalars sort of happened in the code >> > on >> > the fly, so this is a goo

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 wrote: > On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern 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 both integers), then the array dty

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. He

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] 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 wrote: > >> On Tue, Apr 12, 2011 at 12:27, Charles R Harris >> wrote: >> >> > IIRC, the behavior with respect to scalars sort of happened in the code >> on >>

[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 101110

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Pearu Peterson
On Tue, Apr 12, 2011 at 9:06 PM, 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? >

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] 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 wrote: > On Tue, Apr 12, 2011 at 12:27, Charles R Harris > 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 tes

[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 maili

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 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 the tests > have been def

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 wrote: > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern wrote: > >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: >> > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant < >> oliph...@enthought.com> >> > wrote: >> >> >> It would be good to see a simple

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 wrote: > On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern wrote: > >> On Tue, Apr 12, 2011 at 11:20, Mark Wiebe wrote: >> > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern >> wrote: >> >> >> >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: >> >> > On Mo

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 wrote: > On Tue, Apr 12, 2011 at 10:25 AM, Gabriella Turek 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 tr

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 wrote: > On Tue, Apr 12, 2011 at 11:20, Mark Wiebe wrote: > > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern > wrote: > >> > >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: > >> > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant > >> > > >> > wro

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 wrote: > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern wrote: >> >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: >> > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant >> > >> > wrote: >> >> >> It would be good to see a simple test case and understand

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 8:24 AM, Robert Kern wrote: > On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: > > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant > > > wrote: > > >> It would be good to see a simple test case and understand why the > boolean > >> multiplied by the scalar double is bec

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 wrote: > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant > 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 words, >>  why does >> (1-test)*t >> re

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 Pascual > 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 the same arg

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 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) > In both cases