[Numpy-discussion] A bug in boolean indexing?

2010-07-29 Thread Nadav Horesh
The following does not raise an error: a = np.arange(5) a[a0] = a although a.shape == (5,) while a[a0].shape == (4,) I get in on python2.6.5, numpy 1.4.1 on win32, and python 2.6.5, numpy 2.0.0.dev8469 on linux64. Nadav. ___ NumPy-Discussion

Re: [Numpy-discussion] str == int puzzlement

2010-07-29 Thread Matthew Brett
Hi, On Wed, Jul 28, 2010 at 6:49 PM, John Salvatier jsalv...@u.washington.edu wrote: I think this is just Python behavior; comparing python ints and strs also gives False: In [45]: 8 == 'L' Out[45]: False Just to be clear, from: a = np.array(['a','b']) a == 1 I was expecting: array([

Re: [Numpy-discussion] 1.5 release schedule proposal

2010-07-29 Thread Pauli Virtanen
Thu, 29 Jul 2010 02:40:00 +0200, Sturla Molden wrote: Mon, 26 Jul 2010 23:58:11 +0800, Ralf Gommers wrote: Is the current algorithm in the trunk the ziggurat one, or the previous one? IIRC, the problem was that the ziggurat broke reproducibility of random numbers with a given seed. Ziggurat

Re: [Numpy-discussion] 1.5 release schedule proposal

2010-07-29 Thread Sturla Molden
Thu, 29 Jul 2010 02:40:00 +0200, Sturla Molden wrote: Want to submit a patch? ;) I had this in a Matlab MEX file I used for my dissertation. The ziggurat is not hard to program, even for general PDFs. We could even fill in the ziggurat table using numerical integration, and code one for

Re: [Numpy-discussion] 1.5 release schedule proposal

2010-07-29 Thread David Cournapeau
On Thu, Jul 29, 2010 at 6:41 PM, Sturla Molden stu...@molden.no wrote: I had this in a Matlab MEX file I used for my dissertation. The ziggurat is not hard to program, even for general PDFs. We could even fill in the ziggurat table using numerical integration, and code one for general PDFs

Re: [Numpy-discussion] A bug in boolean indexing?

2010-07-29 Thread Alan G Isaac
On 7/29/2010 4:04 AM, Nadav Horesh wrote: a = np.arange(5) a[a0] = a This has nothing to do with reusing ``a``:: b = np.arange(50) a[a0] = b a array([0, 0, 1, 2, 3]) Note however that reusing ``a`` is unsafe. (You will get all zeros.) fwiw, Alan Isaac

Re: [Numpy-discussion] 1.5 release schedule proposal

2010-07-29 Thread Charles R Harris
On Thu, Jul 29, 2010 at 4:59 AM, David Cournapeau courn...@gmail.comwrote: On Thu, Jul 29, 2010 at 6:41 PM, Sturla Molden stu...@molden.no wrote: I had this in a Matlab MEX file I used for my dissertation. The ziggurat is not hard to program, even for general PDFs. We could even fill in the

Re: [Numpy-discussion] 1.5 release schedule proposal

2010-07-29 Thread David Cournapeau
On Thu, Jul 29, 2010 at 10:59 PM, Charles R Harris charlesr.har...@gmail.com wrote: There might be a problem with the endian commits we should look into. From Scott Sinclair on scipy-dev, I am looking into it - I don't understand how it can cause the issue, but that should be quick to fix,

Re: [Numpy-discussion] 1.5 release schedule proposal

2010-07-29 Thread Charles R Harris
On Thu, Jul 29, 2010 at 3:41 AM, Sturla Molden stu...@molden.no wrote: Thu, 29 Jul 2010 02:40:00 +0200, Sturla Molden wrote: Want to submit a patch? ;) I had this in a Matlab MEX file I used for my dissertation. The ziggurat is not hard to program, even for general PDFs. We could even

[Numpy-discussion] additions to random: innovative names vs. algorithm specification

2010-07-29 Thread Alan G Isaac
Rather than just looking for a new name (e.g., znormal), would it not be better to decide on a syntax for specifying PRNG algorithms? (E.g., MATLAB takes such an approach: http://www.mathworks.com/access/helpdesk/help/techdoc/math/brt5wsv.html) Wouldn't this meet the need for replicability with

Re: [Numpy-discussion] additions to random: innovative names vs. algorithm specification

2010-07-29 Thread Charles R Harris
On Thu, Jul 29, 2010 at 8:25 AM, Alan G Isaac alan.is...@gmail.com wrote: Rather than just looking for a new name (e.g., znormal), would it not be better to decide on a syntax for specifying PRNG algorithms? (E.g., MATLAB takes such an approach:

Re: [Numpy-discussion] py3k execfile('setup.py')

2010-07-29 Thread Pauli Virtanen
Thu, 29 Jul 2010 23:39:19 +0800, Ralf Gommers wrote: The execfile builtin has disappeared in python 3.x, so I'm trying to find another solution for the use of it in setupegg.py. So far I've tried I'd do something like this in setup.py: ... + if os.environ.get('USE_SETUPTOOLS'): +

[Numpy-discussion] module compiled against ABI version 2000000 but this version of numpy is 1000009

2010-07-29 Thread Peter Schmidtke
Hi all, I am trying to install manually the latest releases of scipy and numpy on Mac OSX 10.6 Snow Leopard. I previously used the dmg installer that is available, but the numpy version is too new for some other modules I have and need on my machine, so I went for a manual install of numpy 1.4

Re: [Numpy-discussion] module compiled against ABI version 2000000 but this version of numpy is 1000009

2010-07-29 Thread Pauli Virtanen
Thu, 29 Jul 2010 18:45:38 +0200, Peter Schmidtke wrote: I am trying to install manually the latest releases of scipy and numpy on Mac OSX 10.6 Snow Leopard. I previously used the dmg installer that is available, but the numpy version is too new for some other modules I have and need on my

Re: [Numpy-discussion] Datarray sprint July 28, 2010

2010-07-29 Thread Keith Goodman
On Tue, Jul 27, 2010 at 11:13 AM, Keith Goodman kwgood...@gmail.com wrote: Join us for a datarray sprint on July 28. Several of us will meet at UC Berkeley from 2pm (Pacific Time) until our fingers bleed from typing or until 6 or 7pm, whichever comes first. If you can't be there in person,

Re: [Numpy-discussion] module compiled against ABI version 2000000 but this version of numpy is 1000009

2010-07-29 Thread Peter Schmidtke
On 29/07/2010, at 19:01, Pauli Virtanen wrote: Thu, 29 Jul 2010 18:45:38 +0200, Peter Schmidtke wrote: I am trying to install manually the latest releases of scipy and numpy on Mac OSX 10.6 Snow Leopard. I previously used the dmg installer that is available, but the numpy version is too new

Re: [Numpy-discussion] A bug in boolean indexing?

2010-07-29 Thread Nadav Horesh
I was not aware that a[b] = c where b is an integer or boolean indexing array, is legal even if a[b].shape != c.shape. Nadav. -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Alan G Isaac Sent: Thu 29-Jul-10 14:57 To: Discussion of Numerical Python Subject:

Re: [Numpy-discussion] str == int puzzlement

2010-07-29 Thread Keith Goodman
On Wed, Jul 28, 2010 at 6:42 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, Please forgive me if this is obvious, but this surprised me: In [15]: x = np.array(['a', 'b']) In [16]: x == 'a'  # this was what I expected Out[16]: array([ True, False], dtype=bool) In [17]: x == 1 # this

Re: [Numpy-discussion] Is there anyway to read raw binary file via pytable?

2010-07-29 Thread BrainGateway
2010/7/28 Ken Watford kwatford+sc...@gmail.com: 2010/7/28 脑关生命科学仪器 braingate...@gmail.com: it seems like pytable only support HDF5. I had some 500GB numerical arrays to process. Pytable claims to have some advance feature to enhance processing speed and largely reduce physical memory

Re: [Numpy-discussion] additions to random: innovative names vs. algorithm specification

2010-07-29 Thread Robert Kern
On Thu, Jul 29, 2010 at 09:41, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Jul 29, 2010 at 8:25 AM, Alan G Isaac alan.is...@gmail.com wrote: Rather than just looking for a new name (e.g., znormal), would it not be better to decide on a syntax for specifying PRNG algorithms?  

Re: [Numpy-discussion] additions to random: innovative names vs. algorithm specification

2010-07-29 Thread Alan G Isaac
On 7/29/2010 4:37 PM, Robert Kern wrote: this MATLAB API is deprecated The old API has been replaced by a constructor that still takes a string literal argument to determine the PRNG algorithm. See the bottom of http://www.mathworks.com/access/helpdesk/help/techdoc/math/brt5wsv.html This

Re: [Numpy-discussion] additions to random: innovative names vs. algorithm specification

2010-07-29 Thread Robert Kern
On Thu, Jul 29, 2010 at 16:03, Alan G Isaac alan.is...@gmail.com wrote: On 7/29/2010 4:37 PM, Robert Kern wrote: this MATLAB API is deprecated The old API has been replaced by a constructor that still takes a string literal argument to determine the PRNG algorithm. See the bottom of

Re: [Numpy-discussion] Numpy 1.4.1 fails to build on (Debian) alpha and powepc

2010-07-29 Thread Sandro Tosi
Hi! sorry it took so long to reply. On Thu, Jul 29, 2010 at 03:27, David Cournapeau courn...@gmail.com wrote: On Wed, Jul 28, 2010 at 12:36 AM, Sandro Tosi mo...@debian.org wrote: On Tue, Jul 27, 2010 at 14:52, Sandro Tosi mo...@debian.org wrote: Hi, On Tue, Jul 27, 2010 at 12:28, David

Re: [Numpy-discussion] tofile problems

2010-07-29 Thread Paul Probert
On 07/28/2010 11:32 PM, Christopher Barker wrote: Paul Probert wrote: I'm trying to write numpy arrays as binary data, to support a legacy file format. So I open a file and write to it: fp = open('somefile','w') ... oldpos = fp.tell() somenumpyarray.tofile(fp) newpos = fp.tell()

Re: [Numpy-discussion] additions to random: innovative names vs. algorithm specification

2010-07-29 Thread Sturla Molden
On Thu, Jul 29, 2010 at 16:03, Alan G Isaac alan.is...@gmail.com New sampling algorithms aren't invented *all* that often. No, but it seems George Marsaglia posted a new prng called KISS4691 to sci.math last saturday :) KISS4691 has an immense period (larger than 10**45000), and Marsaglia

Re: [Numpy-discussion] Numpy 1.4.1 fails to build on (Debian) alpha and powepc

2010-07-29 Thread David
On 07/30/2010 06:47 AM, Sandro Tosi wrote: For the build logs it's easy: alpha: https://buildd.debian.org/fetch.cgi?pkg=python-numpyarch=alphaver=1%3A1.4.1-4stamp=1280296333file=logas=raw powerpc: