Re: [Numpy-discussion] Inaccuracy in documentation of np.linalg.pinv

2011-03-11 Thread Hao Xiong
Hi Ralf, I am happy to edit it, although I will have to do it later as I won't have much free time recently. I have registered as haoxiong on docs.scipy.org and would like to request edit rights to the pinv page. Thanks, Hao On 03/09/11 04:16, Ralf Gommers wrote: > Hi Hao, > > On Wed, Mar 9, 2

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 12:37 PM, Pauli Virtanen wrote: > On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote: > [clip] > > What about views? Wouldn't it be easier to write another object wrapping > > an ndarray? > > I think the buffer interfaces and all other various ways Numpy provides >

Re: [Numpy-discussion] Structured array copying by field name (was: Numpy 1.6 schedule)

2011-03-11 Thread Benjamin Root
On Fri, Mar 11, 2011 at 2:20 PM, Mark Wiebe wrote: > On Fri, Mar 11, 2011 at 1:07 AM, Ralf Gommers > wrote: > >> On Tue, Mar 8, 2011 at 1:35 AM, Pauli Virtanen wrote: >> > >> > Structured array copying copies by field name. >> > >> > Commit 22d96096bf7d5fb199ca80f2fcd04e8d27815476 >> > >> > Bef

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Benjamin Root
On Fri, Mar 11, 2011 at 4:33 PM, Charles R Harris wrote: > > > On Fri, Mar 11, 2011 at 1:10 PM, Mark Wiebe wrote: > >> On Fri, Mar 11, 2011 at 8:19 AM, Travis Oliphant >> wrote: >> >>> This discussion is interesting and useful for NumPy 2.0, but the subtle >>> change is not acceptable for NumPy

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Dag Sverre Seljebotn
On 03/11/2011 10:04 PM, Anne Archibald wrote: > On 11 March 2011 15:34, Charles R Harris wrote: >> On Fri, Mar 11, 2011 at 1:06 PM, Dag Sverre Seljebotn >> wrote: >>> On Fri, 11 Mar 2011 19:37:42 + (UTC), Pauli Virtanen >>> wrote: On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 1:10 PM, Mark Wiebe wrote: > On Fri, Mar 11, 2011 at 8:19 AM, Travis Oliphant > wrote: > >> This discussion is interesting and useful for NumPy 2.0, but the subtle >> change is not acceptable for NumPy 1.6. >> >> The rules were consistent, even if seen as unintuitive by s

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Anne Archibald
On 11 March 2011 15:34, Charles R Harris wrote: > > On Fri, Mar 11, 2011 at 1:06 PM, Dag Sverre Seljebotn > wrote: >> >> On Fri, 11 Mar 2011 19:37:42 + (UTC), Pauli Virtanen >> wrote: >> > On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote: >> > [clip] >> >> What about views? Would

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 1:06 PM, Dag Sverre Seljebotn < d.s.seljeb...@astro.uio.no> wrote: > On Fri, 11 Mar 2011 19:37:42 + (UTC), Pauli Virtanen > wrote: > > On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote: > > [clip] > >> What about views? Wouldn't it be easier to write another

Re: [Numpy-discussion] memory layout, K vs C order (was: Numpy 1.6 schedule)

2011-03-11 Thread Mark Wiebe
On Fri, Mar 11, 2011 at 1:13 AM, Ralf Gommers wrote: > On Tue, Mar 8, 2011 at 1:35 AM, Pauli Virtanen wrote: > > > > Ufuncs don't necessarily return arrays in C-order, but instead > > try to keep the memory layout of the original if it seems > > advantageous vs. memory access. > > > > Before: > >

Re: [Numpy-discussion] Structured array copying by field name (was: Numpy 1.6 schedule)

2011-03-11 Thread Mark Wiebe
On Fri, Mar 11, 2011 at 1:07 AM, Ralf Gommers wrote: > On Tue, Mar 8, 2011 at 1:35 AM, Pauli Virtanen wrote: > > > > Structured array copying copies by field name. > > > > Commit 22d96096bf7d5fb199ca80f2fcd04e8d27815476 > > > > Before: > > > x = np.array([(0, 1)], dtype=[('a', int), ('b', in

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Mark Wiebe
On Fri, Mar 11, 2011 at 8:19 AM, Travis Oliphant wrote: > This discussion is interesting and useful for NumPy 2.0, but the subtle > change is not acceptable for NumPy 1.6. > > The rules were consistent, even if seen as unintuitive by some. > > The fact that two libraries we know of already had tes

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Dag Sverre Seljebotn
On Fri, 11 Mar 2011 19:37:42 + (UTC), Pauli Virtanen wrote: > On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote: > [clip] >> What about views? Wouldn't it be easier to write another object >> wrapping >> an ndarray? > > I think the buffer interfaces and all other various ways Nump

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Pauli Virtanen
On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote: [clip] > What about views? Wouldn't it be easier to write another object wrapping > an ndarray? I think the buffer interfaces and all other various ways Numpy provides exports for arrays make keeping tabs on modification impossible to do

Re: [Numpy-discussion] loop vectorization

2011-03-11 Thread qubax
we have had that discussion about ... two days ago. please look up 'How to sum weighted matrices' with at least two efficient solutions. On Fri, Mar 11, 2011 at 02:00:09PM -0500, Josh Hykes wrote: >I think you can use tensordot here. Maybe something like the >following: > >from numpy

Re: [Numpy-discussion] loop vectorization

2011-03-11 Thread Josh Hykes
I think you can use tensordot here. Maybe something like the following: from numpy.random import random import numpy as np ni, nj, nk = 4, 5, 6 bipData = random((ni,nj,nk)) data1 = np.zeros((nk,nk)) # loop for i in range(nj): data1 += np.dot(np.transpose(bipData[:,i,:]), bipData[:,i,:]) #

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 11:41 AM, Dag Sverre Seljebotn < d.s.seljeb...@astro.uio.no> wrote: > There's a few libraries out there that needs to know whether or not an > array changed since the last time it was used: joblib and pymc comes to > mind. I believe joblib computes a SHA1 or md5 hash of arr

[Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Dag Sverre Seljebotn
There's a few libraries out there that needs to know whether or not an array changed since the last time it was used: joblib and pymc comes to mind. I believe joblib computes a SHA1 or md5 hash of array contents, while pymc simply assume you never change an array and uses the id(). The pymc app

[Numpy-discussion] Using ndpointer with ctypes argtypes

2011-03-11 Thread Josh Mayer
I am trying to call a C function that takes a double array as one of its parameters. I am using ndpointer to define the argtypes so that I can pass a numpy array directly. The issue I'm having is that this parameter need not always be set, and when it is not set, the C functions expects a null po

[Numpy-discussion] loop vectorization

2011-03-11 Thread Thomas K Gamble
I have the followin loop in my code: for i in range(0, nFrames): data += dot(transpose(bipData[:,i,:]), bipData[:,i,:]) bipData is a 1024x258x256 double precision float array. The loop takes all of 15 seconds to run on my computer and, with several hundred files to process... Is t

Re: [Numpy-discussion] how to compile Fortran using setup.py

2011-03-11 Thread Ondrej Certik
On Fri, Mar 11, 2011 at 12:24 AM, Dag Sverre Seljebotn wrote: > On 03/11/2011 09:13 AM, Dag Sverre Seljebotn wrote: >> On 03/11/2011 07:57 AM, Ondrej Certik wrote: >>> On Thu, Mar 10, 2011 at 8:25 PM, Robert Kern   wrote: On Thu, Mar 10, 2011 at 19:58, Ondrej Certik   wrote: > Hi, > >

Re: [Numpy-discussion] ragged array implimentation

2011-03-11 Thread Francesc Alted
A Thursday 10 March 2011 22:25:27 Christopher Barker escrigué: > On 3/10/11 12:01 PM, Francesc Alted wrote: > >> 3) when the extra space is used up, it re-allocates the entire > >> array, with some more extra room > > > > again, carray works exactly the same: the extra room is just a new > > chunk

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 9:19 AM, Travis Oliphant wrote: > This discussion is interesting and useful for NumPy 2.0, but the subtle > change is not acceptable for NumPy 1.6. > > The rules were consistent, even if seen as unintuitive by some. > > The fact that two libraries we know of already had tes

Re: [Numpy-discussion] Anybody going to PyCon?

2011-03-11 Thread Charles R Harris
On Mon, Mar 7, 2011 at 7:11 AM, David Cournapeau wrote: > On Mon, Mar 7, 2011 at 5:53 PM, Gökhan Sever > wrote: > > Hello, > > > > I am going to the PyCon this week. I am presenting a poster about an > > atmospheric sciences related project -- the most active development > > from my coding site

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Travis Oliphant
This discussion is interesting and useful for NumPy 2.0, but the subtle change is not acceptable for NumPy 1.6. The rules were consistent, even if seen as unintuitive by some. The fact that two libraries we know of already had tests break should be a big red warning flag. There are a lot of ot

[Numpy-discussion] assert_almost_equal bug?

2011-03-11 Thread Keith Goodman
assert_almost_equal() and assert_array_almost_equal() raise a ValueError instead of an AssertionError when the array contains np.inf: >> a = np.array([[1., 2.], [3., 4.]]) >> b = a.copy() >> np.testing.assert_almost_equal(a, b) >> b[0,0] = np.inf >> np.testing.assert_almost_equal(a, b) ValueError

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 8:06 AM, Wes McKinney wrote: > On Fri, Mar 11, 2011 at 9:57 AM, Charles R Harris > wrote: > > > > > > On Fri, Mar 11, 2011 at 7:42 AM, Charles R Harris > > wrote: > >> > >> > >> On Fri, Mar 11, 2011 at 2:01 AM, Ralf Gommers > >> wrote: > >>> > >>> I'm just going through

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Wes McKinney
On Fri, Mar 11, 2011 at 9:57 AM, Charles R Harris wrote: > > > On Fri, Mar 11, 2011 at 7:42 AM, Charles R Harris > wrote: >> >> >> On Fri, Mar 11, 2011 at 2:01 AM, Ralf Gommers >> wrote: >>> >>> I'm just going through the very long 1.6 schedule thread to see what >>> is still on the TODO list be

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 7:42 AM, Charles R Harris wrote: > > > On Fri, Mar 11, 2011 at 2:01 AM, Ralf Gommers > wrote: > >> I'm just going through the very long 1.6 schedule thread to see what >> is still on the TODO list before a 1.6.x branch can be made. So I'll >> send a few separate mails, on

Re: [Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Charles R Harris
On Fri, Mar 11, 2011 at 2:01 AM, Ralf Gommers wrote: > I'm just going through the very long 1.6 schedule thread to see what > is still on the TODO list before a 1.6.x branch can be made. So I'll > send a few separate mails, one for each topic. > > On Mon, Mar 7, 2011 at 8:30 PM, Francesc Alted >

[Numpy-discussion] memory layout, K vs C order (was: Numpy 1.6 schedule)

2011-03-11 Thread Ralf Gommers
On Tue, Mar 8, 2011 at 1:35 AM, Pauli Virtanen wrote: > > Ufuncs don't necessarily return arrays in C-order, but instead > try to keep the memory layout of the original if it seems > advantageous vs. memory access. > > Before: > np.sin(np.zeros((5,5,5)).transpose(1,2,0)).strides > (200, 40, 8

[Numpy-discussion] Structured array copying by field name (was: Numpy 1.6 schedule)

2011-03-11 Thread Ralf Gommers
On Tue, Mar 8, 2011 at 1:35 AM, Pauli Virtanen wrote: > > Structured array copying copies by field name. > > Commit 22d96096bf7d5fb199ca80f2fcd04e8d27815476 > > Before: > x = np.array([(0, 1)], dtype=[('a', int), ('b', int)]) y = np.array([(2, 3)], dtype=[('a', int), ('b', int)]) y

[Numpy-discussion] broadcasting behavior for 1.6 (was: Numpy 1.6 schedule)

2011-03-11 Thread Ralf Gommers
I'm just going through the very long 1.6 schedule thread to see what is still on the TODO list before a 1.6.x branch can be made. So I'll send a few separate mails, one for each topic. On Mon, Mar 7, 2011 at 8:30 PM, Francesc Alted wrote: > A Sunday 06 March 2011 06:47:34 Mark Wiebe escrigué: >>

Re: [Numpy-discussion] how to compile Fortran using setup.py

2011-03-11 Thread Dag Sverre Seljebotn
On 03/11/2011 09:13 AM, Dag Sverre Seljebotn wrote: > On 03/11/2011 07:57 AM, Ondrej Certik wrote: >> On Thu, Mar 10, 2011 at 8:25 PM, Robert Kern wrote: >>> On Thu, Mar 10, 2011 at 19:58, Ondrej Certik wrote: Hi, I spent about an hour googling and didn't figure this out. Here is

Re: [Numpy-discussion] how to compile Fortran using setup.py

2011-03-11 Thread Dag Sverre Seljebotn
On 03/11/2011 07:57 AM, Ondrej Certik wrote: > On Thu, Mar 10, 2011 at 8:25 PM, Robert Kern wrote: >> On Thu, Mar 10, 2011 at 19:58, Ondrej Certik wrote: >>> Hi, >>> >>> I spent about an hour googling and didn't figure this out. Here is my >>> setup.py: >>> >>> setup( >>> name = "libqsnake",