Re: [Numpy-discussion] Iterative Matrix Multiplication

2010-03-04 Thread Ian Mallett
Firstly, I want to thank you for all the time and attention you've obviously put into this code. On Tue, Mar 2, 2010 at 12:27 AM, Friedrich Romstedt < friedrichromst...@gmail.com> wrote: > The loop I can replace by numpy operations: > > >>> v_array > array([[1, 2, 3], > [4, 5, 6], > [

Re: [Numpy-discussion] Building Numpy Windows Superpack

2010-03-04 Thread David Cournapeau
Patrick Marsh wrote: > > I've hacked the pavement script to check for the version of python I'm > using to build with and have it use MinGW for versions Python 2.5 and > earlier and MSVC for Python 2.6 and later. I hope to install MSVC7.1 > tomorrow...if I can find my disks. Then I should be

Re: [Numpy-discussion] Building Numpy Windows Superpack

2010-03-04 Thread Patrick Marsh
On Wed, Mar 3, 2010 at 8:12 PM, David Cournapeau wrote: > Patrick Marsh wrote: > > On Wed, Mar 3, 2010 at 8:48 AM, David Cournapeau > > wrote: > > > > > That's a bug in the pavement script - on windows 7, some env > variables > > are necessary to run python corr

Re: [Numpy-discussion] memory usage of numpy arrays

2010-03-04 Thread Robert Kern
On Thu, Mar 4, 2010 at 19:10, kaby wrote: > > Hi. > I am using numpy arrays and when constructing an array I get a  "cannot > allocate memory for thread-local data: ABORT" > The array i'm constructing is > zeros((numVars, 2, numVars, 2), dtype=float) Where numVars is at about 2000. > > I was expec

[Numpy-discussion] memory usage of numpy arrays

2010-03-04 Thread kaby
Hi. I am using numpy arrays and when constructing an array I get a "cannot allocate memory for thread-local data: ABORT" The array i'm constructing is zeros((numVars, 2, numVars, 2), dtype=float) Where numVars is at about 2000. I was expecting the memory usage to be 2000*2000*2*2*8Bytes=128.000.

Re: [Numpy-discussion] how to efficiently build an array of x, y, z points

2010-03-04 Thread Brennan Williams
Christopher Barker wrote: Bruce Southey wrote: Christopher Barker provided some code last last year on appending ndarrays eg: http://mail.scipy.org/pipermail/numpy-discussion/2009-November/046634.html yup, I"d love someone else to pick that up and test/improve it. Anyway, that code o

Re: [Numpy-discussion] dtype for a single char

2010-03-04 Thread sam tygier
Robert Kern wrote: > On Thu, Mar 4, 2010 at 02:34, sam tygier wrote: >> Robert Kern wrote: >>> On Wed, Mar 3, 2010 at 15:14, sam tygier wrote: Hello today i was caught out by trying to use 'a' as a dtype for a single character. a simple example would be: >>> array([(

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Nadav Horesh
I can not give a reliable answer yet, since I have some more improvement to make. The application is an analysis of a stereoscopic-movie raw-data recording (both channels are recorded in the same file). I treat the data as a huge memory mapped file. The idea was to process each channel (left and

Re: [Numpy-discussion] dtype for a single char

2010-03-04 Thread Robert Kern
On Thu, Mar 4, 2010 at 02:34, sam tygier wrote: > Robert Kern wrote: >> On Wed, Mar 3, 2010 at 15:14, sam tygier wrote: >>> Hello >>> >>> today i was caught out by trying to use 'a' as a dtype for a single >>> character. a simple example would be: >>> >> array([('a',1),('b',2),('c',3)], dtyp

Re: [Numpy-discussion] Building Numpy Windows Superpack

2010-03-04 Thread Patrick Marsh
On Wed, Mar 3, 2010 at 8:12 PM, David Cournapeau wrote: > Patrick Marsh wrote: > > On Wed, Mar 3, 2010 at 8:48 AM, David Cournapeau > > wrote: > > > > > That's a bug in the pavement script - on windows 7, some env > variables > > are necessary to run python corr

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Francesc Alted
What kind of calculations are you doing with this module? Can you please send some examples and the speed-ups you are getting? Thanks, Francesc A Thursday 04 March 2010 14:06:34 Nadav Horesh escrigué: > Extended module that I used for some useful work. > Comments: > 1. Sturla's module is bett

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Nadav Horesh
Extended module that I used for some useful work. Comments: 1. Sturla's module is better designed, but did not work with very large (although sub GB) arrays 2. Tested on 64 bit linux (amd64) + python-2.6.4 + numpy-1.4.0 Nadav. -Original Message- From: numpy-discussion-boun...@scip

Re: [Numpy-discussion] combinatorics

2010-03-04 Thread Ernest Adrogué
4/03/10 @ 12:26 (+0100), thus spake Johan Grönqvist: > Ernest Adrogué skrev: > > Suppose I want to find all 2-digit numbers whose first digit > > is either 4 or 5, the second digit being 7, 8 or 9. > > > > I came up with this function, the problem is it uses recursion: > > [...] > > In [157]: g(

Re: [Numpy-discussion] combinatorics

2010-03-04 Thread Johan Grönqvist
Ernest Adrogué skrev: > Suppose I want to find all 2-digit numbers whose first digit > is either 4 or 5, the second digit being 7, 8 or 9. > > I came up with this function, the problem is it uses recursion: > [...] > In [157]: g([[4,5],[7,8,9]]) > Out[157]: [[4, 7], [4, 8], [4, 9], [5, 7], [5, 8]

Re: [Numpy-discussion] combinatorics

2010-03-04 Thread Sam Tygier
itertools in the python standard library has what you need >>> import itertools >>> list( itertools.product([4,5], [7,8,9]) ) [(4, 7), (4, 8), (4, 9), (5, 7), (5, 8), (5, 9)] (all the itertools functions return generators, so the list() is to convert it to a list) Sam __

Re: [Numpy-discussion] combinatorics

2010-03-04 Thread Ernest Adrogué
4/03/10 @ 11:19 (+0100), thus spake Ernest Adrogué: > Hello everybody, > > Suppose I want to find all 2-digit numbers whose first digit > is either 4 or 5, the second digit being 7, 8 or 9. > Is there a Numpy/Scipy function to calculate that kind of > combinations? > > I came up with this functi

[Numpy-discussion] combinatorics

2010-03-04 Thread Ernest Adrogué
Hello everybody, Suppose I want to find all 2-digit numbers whose first digit is either 4 or 5, the second digit being 7, 8 or 9. Is there a Numpy/Scipy function to calculate that kind of combinations? I came up with this function, the problem is it uses recursion: def g(sets): if len(sets)

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Nadav Horesh
Maybe the attached file can help. Adpted and tested on amd64 linux Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Nadav Horesh Sent: Thu 04-Mar-10 10:54 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] multiprocessing shared arrays and

Re: [Numpy-discussion] dtype for a single char

2010-03-04 Thread sam tygier
Robert Kern wrote: > On Wed, Mar 3, 2010 at 15:14, sam tygier wrote: >> Hello >> >> today i was caught out by trying to use 'a' as a dtype for a single >> character. a simple example would be: >> > array([('a',1),('b',2),('c',3)], dtype=[("letter", "a"), ("number", "i")]) >> array([('', 1), (