Re: [Numpy-discussion] probably simple, reverse a reshape...

2009-02-23 Thread John [H2O]
John [H2O] wrote: > > Hello, this is probably one of those questions that is going to seem > simple after reading responses... > and a few more minutes of thinking: def row2shape(row,a): """ to get indices a 2d array row# to the 3d array from which it was reshaped. "" d0,d1

[Numpy-discussion] probably simple, reverse a reshape...

2009-02-23 Thread John [H2O]
Hello, this is probably one of those questions that is going to seem simple after reading responses... I'm trying to get the original array indices out of a row number from a reshaped array... shouldn't this be possible somehow? import numpy as np a = np.ones((3,5,10)) #for testing, I've done t

Re: [Numpy-discussion] Core math library in numpy

2009-02-23 Thread Charles R Harris
On Mon, Feb 23, 2009 at 2:02 PM, David Cournapeau wrote: > On Fri, Feb 20, 2009 at 5:26 PM, Pauli Virtanen wrote: > > Fri, 20 Feb 2009 01:05:03 +0900, David Cournapeau wrote: > > [clip] > >>> I think they should be. Then we could easily use C99 complex math > >>> functions on plaforms on which th

Re: [Numpy-discussion] Core math library in numpy

2009-02-23 Thread David Cournapeau
On Fri, Feb 20, 2009 at 5:26 PM, Pauli Virtanen wrote: > Fri, 20 Feb 2009 01:05:03 +0900, David Cournapeau wrote: > [clip] >>> I think they should be. Then we could easily use C99 complex math >>> functions on plaforms on which they are available (and so get the >>> "correct" corner-case semantics

Re: [Numpy-discussion] block matrix and sums of blocks

2009-02-23 Thread Xavier Gnata
Robert Kern wrote: > On Sun, Feb 22, 2009 at 19:39, Xavier Gnata wrote: > >> Hi, >> >> Let us consider one kN x kM array. >> What is the fastest way to sum each k x k square block of A and to put >> all these results into a NxM array B? >> >> For instance: >> If A = >> [112233 >> 112233 >> 22

Re: [Numpy-discussion] [matplotlib-devel] [Nipy-devel] Sphinx custom extension mess, and patches

2009-02-23 Thread Michael Droettboom
Thanks, Fernando. I've applied your patch to matplotlib (branch and trunk). Mike Fernando Perez wrote: > On Mon, Feb 16, 2009 at 3:21 PM, Gael Varoquaux > wrote: > > >> I am not blaming anyone, just pointing out a non ideal situation. It has >> already improved a lot with the matplotlib guys

Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-23 Thread Tim
Hi, My Python is Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) Here is the output: >>> print numpy >>> print numpy.__version__ 1.1.1 Are these compatible with each other? I just found the error goes away, after I restart my ubuntu 8.10. Thanks, -Tim --- On Sun, 2/22/09, Stéfan van der Walt

Re: [Numpy-discussion] How to generate equivalent "random" numbers in matlab and numpy?

2009-02-23 Thread Sturla Molden
On 2/23/2009 1:11 PM, Nicolas Pinto wrote: > Dear all, > > I'd like to generate equivalent sequences of 'random' numbers in matlab > and numpy, is there any way I can do that? ... Asked and answered on scipy-user. S.M. ___ Numpy-discussion mailin

[Numpy-discussion] How to generate equivalent "random" numbers in matlab and numpy?

2009-02-23 Thread Nicolas Pinto
Dear all, I'd like to generate equivalent sequences of 'random' numbers in matlab and numpy, is there any way I can do that? I tried to fix the seed (see below) but it doesn't work. # numpy In [29]: np.random.seed(1); np.random.permutation(5)+1 Out[29]: array([3, 2, 5, 1, 4]) % matlab >> rand('s