[Numpy-discussion] odd installation problem of numpy/matplotlib

2007-03-29 Thread Giorgio Luciano
Sorry if the message will arrive in duplicate I had some problem with posting in the mailing list I've installed in my machine in the following order python 2.5 numpy 1.01 matplot lib 0.87 scipy 0.52 wxPython 2.8 with no problem I've also installed the same packages at home and in another two co

Re: [Numpy-discussion] I've just commited a fast-clip function

2007-03-29 Thread David Cournapeau
Travis Oliphant wrote: > Hey folks, > > I've just committed a revision of ticket #425 to speed up clipping in > the scalar case. I also altered the PyArray_Conjugate function (called > by the conjugate method) to use the ufunc for complex data. > > These were some relatively largish changes to

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Bill Baxter
On 3/30/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > > On 3/29/07, Bill Baxter <[EMAIL PROTECTED]> wrote: > > On 3/30/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > > Note, however that you can't (for instance) multiply column vector with > > > a row vector: > > > > > > >>> (c)(r) > > >

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Zachary Pincus
Looks promising! > On 3/29/07, Bill Baxter <[EMAIL PROTECTED]> wrote: On 3/30/07, > Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > Note, however that you can't (for instance) multiply column > vector with > > a row vector: > > > > >>> (c)(r) > > Traceback (most recent call last): > > ... >

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Charles R Harris
On 3/29/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: On 3/29/07, Bill Baxter <[EMAIL PROTECTED]> wrote: > > On 3/30/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > Note, however that you can't (for instance) multiply column vector > with > > a row vector: > > > > >>> (c)(r) > > Tracebac

[Numpy-discussion] I've just commited a fast-clip function

2007-03-29 Thread Travis Oliphant
Hey folks, I've just committed a revision of ticket #425 to speed up clipping in the scalar case. I also altered the PyArray_Conjugate function (called by the conjugate method) to use the ufunc for complex data. These were some relatively largish changes to the source code (all behind the s

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Timothy Hochberg
On 3/29/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: On 3/29/07, Bill Baxter <[EMAIL PROTECTED]> wrote: > > On 3/30/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > Note, however that you can't (for instance) multiply column vector > with > > a row vector: > > > > >>> (c)(r) > > Tracebac

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Timothy Hochberg
On 3/29/07, Bill Baxter <[EMAIL PROTECTED]> wrote: On 3/30/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > Note, however that you can't (for instance) multiply column vector with > a row vector: > > >>> (c)(r) > Traceback (most recent call last): > ... > TypeError: Cannot matrix multiply col

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Bill Baxter
On 3/30/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > Note, however that you can't (for instance) multiply column vector with > a row vector: > > >>> (c)(r) > Traceback (most recent call last): > ... > TypeError: Cannot matrix multiply columns with anything > That should be allowed. (N,1)*(

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Timothy Hochberg
"""matrix.py The discussion about matrix indexing has been interminible and for the most part pretty pointless IMO. However, it does point out one thing: the interaction between the matrix and array classes is still pretty klunky despite a fair amount of effort trying to make them interoperate.

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Bill Spotz
On Mar 29, 2007, at 6:48 PM, Alan G Isaac wrote: > On Thu, 29 Mar 2007, Bill Spotz apparently wrote: >> What I envisioned was that M[i,:] would return >> a row_vector and M[:,j] would return a column_vector, >> because this would be symmetric behavior. M[i], by >> convention, would behave the sam

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Alan G Isaac
On Thu, 29 Mar 2007, Bill Spotz apparently wrote: > What I envisioned was that M[i,:] would return > a row_vector and M[:,j] would return a column_vector, > because this would be symmetric behavior. M[i], by > convention, would behave the same as M[i,:]. Can you please be explicit about the

Re: [Numpy-discussion] .data doesn't account for .transpose()?

2007-03-29 Thread David M. Cooke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Charles R Harris wrote: > On 3/29/07, Anne Archibald <[EMAIL PROTECTED]> wrote: >> > > I think the preferred names are C_CONTIGUOUS and F_CONTIGUOUS, for > instance: > > In [2]:eye(2).flags['C_CONTIGUOUS'] > Out[2]:True > > In [3]:eye(2).T.flags['F_

Re: [Numpy-discussion] .data doesn't account for .transpose()?

2007-03-29 Thread Charles R Harris
On 3/29/07, Anne Archibald <[EMAIL PROTECTED]> wrote: On 29/03/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Glen W. Mabey wrote: > > > So, would that imply that a .copy() should be done first on any array > > that you want to access .data on? > > Or even ascontiguousarray(). I'd like to point o

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Brian Granger
We looked at the BSP model at various points in implementing the parallel IPython stuff. While I wouldn't say that IPython uses a BSP model, there are some similarities. But in the broader realm of scientific computing, BSP has never really caught on like MPI has - in spite of having some nice id

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Charles R Harris
On 3/29/07, Bill Spotz <[EMAIL PROTECTED]> wrote: What I envisioned was that M[i,:] would return a row_vector and M [:,j] would return a column_vector, because this would be symmetric behavior. M[i], by convention, would behave the same as M[i,:]. But then I personally don't distinguish betwee

Re: [Numpy-discussion] .data doesn't account for .transpose()?

2007-03-29 Thread Anne Archibald
On 29/03/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Glen W. Mabey wrote: > > > So, would that imply that a .copy() should be done first on any array > > that you want to access .data on? > > Or even ascontiguousarray(). I'd like to point out that the numpy usage of the word "contiguous" is a bit

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Sebastian Haase
Hi, What is the general feeling towards BSP on this list !? I remeber Konrad Hinsen advertising it on the SciPy workshop '03 . It is supposed to be much simpler to use than MPI, yet still powerful and flexible enough for most all applications. It is part of Konrad's ScientificPython ( != SciPy )

[Numpy-discussion] GC support

2007-03-29 Thread Eric Firing
Travis and others, In the course of trying to understand memory leaks in matplotlib I have been trying to understand a bit about the garbage collector. If I understand correctly, any container that can can hold references to other containers could lead to a reference cycle; if the container s

Re: [Numpy-discussion] .data doesn't account for .transpose()?

2007-03-29 Thread Robert Kern
Glen W. Mabey wrote: > So, would that imply that a .copy() should be done first on any array > that you want to access .data on? Or even ascontiguousarray(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attemp

Re: [Numpy-discussion] .data doesn't account for .transpose()?

2007-03-29 Thread Robert Kern
Glen W. Mabey wrote: > Hello, > > I imagine that perhaps this issue I'm seeing is only an issue because I > don't thoroughly understand the buffer issues associated with numpy > arrays, but here it is anyway: > > In [16]:a1 = numpy.zero > numpy.zeros numpy.zeros_like > > In [16]:a1 = num

[Numpy-discussion] .data doesn't account for .transpose()?

2007-03-29 Thread Glen W. Mabey
Hello, I imagine that perhaps this issue I'm seeing is only an issue because I don't thoroughly understand the buffer issues associated with numpy arrays, but here it is anyway: In [16]:a1 = numpy.zero numpy.zeros numpy.zeros_like In [16]:a1 = numpy.zeros( (2,2) ) In [17]:a1[0,:] = 1

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Bill Spotz
What I envisioned was that M[i,:] would return a row_vector and M [:,j] would return a column_vector, because this would be symmetric behavior. M[i], by convention, would behave the same as M[i,:]. But then I personally don't distinguish between "python indexing" and "numpy indexing". In bo

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Alan G Isaac
On Tue, 27 Mar 2007, Zachary Pincus apparently wrote: > Now, Bill offers up a different suggestion: indexing > M yields neither a matrix nor an array, but a class that > operates more or less like an array, except insofar as it > interacts with other matrix objects, or other objects of > simil

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Peter Skomoroch
If you want to use PyMPI or PyPar, I'm writing a series of tutorials on how to get them running on Amazon EC2, http://www.datawrangling.com/on-demand-mpi-cluster-with-python-and-ec2-part-1-of-3.html I'm using PyMPI on a 20 node EC2 cluster and everything seems groovy, but I'm relatively new to

Re: [Numpy-discussion] 2D Arrays column operations

2007-03-29 Thread Lou Pecora
Others can correct me, but I believe the ndarrys of numpy are *not* stored like C arrays, but rather as a contiguous memory chunk (there are some exceptions, but ignore for the moment). Then along with the data is a structure that tells numpy how to "address" the array's data memory using indices

Re: [Numpy-discussion] Should 0-d arrays with fields defined return a 0-d array or a scalar

2007-03-29 Thread Christopher Hanley
Hi Travis, We will need a little time to inspect our code to see if this is going to be a problem for us. We can't think of any major problems with this change off the top of our heads. Chris Travis Oliphant wrote: > Hi all, > > Ticket #474 discusses the problem that getting a field from a

Re: [Numpy-discussion] 2D Arrays column operations

2007-03-29 Thread Simon Berube
Awww, this is quite right. I kept using the a[0][:] notation and I assume I am simply pulling out single arrays from the array "list". Thank you very much for the prompt reply. (And sorry for wasting your time :P) On Mar 29, 3:46 pm, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Simon Berube wrote

Re: [Numpy-discussion] 2D Arrays column operations

2007-03-29 Thread Stefan van der Walt
On Thu, Mar 29, 2007 at 07:43:03PM -, Simon Berube wrote: > Hi, >I am relatively new to Python/NumPy switching over from Matlab and > while porting some of my matlab code for practice I ran into the > following problem. > > Assume we have a 2D Matrix such that > a = array([[1, 2, 3], >

Re: [Numpy-discussion] 2D Arrays column operations

2007-03-29 Thread Travis Oliphant
Simon Berube wrote: >c = a(:,2) to get the values array([2,5,8]) > > Actually (0-based indexing) c = a[:,1] -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] 2D Arrays column operations

2007-03-29 Thread Travis Oliphant
Simon Berube wrote: >Hi, > I am relatively new to Python/NumPy switching over from Matlab and >while porting some of my matlab code for practice I ran into the >following problem. > >Assume we have a 2D Matrix such that >a = array([[1, 2, 3], > [4, 5, 6], > [7, 8, 9]]

[Numpy-discussion] 2D Arrays column operations

2007-03-29 Thread Simon Berube
Hi, I am relatively new to Python/NumPy switching over from Matlab and while porting some of my matlab code for practice I ran into the following problem. Assume we have a 2D Matrix such that a = array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) If I want the second row I

[Numpy-discussion] Should 0-d arrays with fields defined return a 0-d array or a scalar

2007-03-29 Thread Travis Oliphant
Hi all, Ticket #474 discusses the problem that getting a field from a 0-d array automatically produces a scalar (which then cannot be set). This produces the problem that recarrays code must often special-case the 0-d possibility. Thus, rarr.x[...] = blah doesn't work for 0-d arrays because r

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Pierre GM
On Thursday 29 March 2007 14:40:35 Bryce Hendrix wrote: > Yup, we've decided to write custom concatenate & where methods. Thanks > for all the help. Don't mention it, my pleasure. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projec

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Bryce Hendrix
Yup, we've decided to write custom concatenate & where methods. Thanks for all the help. Bryce Pierre GM wrote: On Thursday 29 March 2007 14:09:38 Bryce Hendrix wrote: I really should widen my tests before proclaiming success... If you change the default units to "feet", the result of conc

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Pierre GM
On Thursday 29 March 2007 14:09:38 Bryce Hendrix wrote: > I really should widen my tests before proclaiming success... If you > change the default units to "feet", the result of concatenating two > UnitArrays instances with "meters" units is a UnitArray with "feet". Not a surprise at all, and I sh

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Bryce Hendrix
Yeah, I think we may need to write some custom wrapper functions for the functions we use which don't call __new__. I don't really see another way around it since by the time __array_finalize__ gets called there are no units and the problems with mixed units. bryce Pierre GM wrote: On Thursd

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Bryce Hendrix
I really should widen my tests before proclaiming success... If you change the default units to "feet", the result of concatenating two UnitArrays instances with "meters" units is a UnitArray with "feet". Bryce Pierre GM wrote: On Thursday 29 March 2007 12:04:51 Bryce Hendrix wrote: I spo

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Pierre GM
On Thursday 29 March 2007 13:47:48 Bryce Hendrix wrote: > doh! I followed the example on the Wiki which does not define the class > attribute in the class scope, but in __new__. Adding the declaration to > the class scope seems to work. Yeah, sorry about that, I really should update this wiki page

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Bryce Hendrix
doh! I followed the example on the Wiki which does not define the class attribute in the class scope, but in __new__. Adding the declaration to the class scope seems to work. Thanks, Bryce Pierre GM wrote: On Thursday 29 March 2007 12:04:51 Bryce Hendrix wrote: I spoke too soon, this code

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Pierre GM
On Thursday 29 March 2007 12:04:51 Bryce Hendrix wrote: > I spoke too soon, this code fails with the example you gave: mmh, I tried to use the class you linked to last time: the only modifications I gave are listed below class UnitArray(numpy.ndarray): __array_priority__ = 10.0 default_u

Re: [Numpy-discussion] Windows binary release?

2007-03-29 Thread Francesc Altet
El dj 29 de 03 del 2007 a les 09:42 -0700, en/na Travis Oliphant va escriure: > Charles R Harris wrote: > > > > > > > On 3/28/07, *Travis Oliphant* <[EMAIL PROTECTED] > > > wrote: > > > > Christopher Ball wrote: > > > Hi, > > > > > > I wonder if anyone ca

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Brian Granger
A few replies have already given you some idea of the options. A comments to supplement those made so far: 1. mpi4py. I have used this quite a bit and it is incredible. It seems to build just about anywhere, and it has very complete coverage of the mpi spec - even the mpi-2 stuff. In fact, th

Re: [Numpy-discussion] Windows binary release?

2007-03-29 Thread Travis Oliphant
Charles R Harris wrote: > > > On 3/28/07, *Travis Oliphant* <[EMAIL PROTECTED] > > wrote: > > Christopher Ball wrote: > > Hi, > > > > I wonder if anyone can tell me when the next release is planned? Or > > specifically, any idea when a new Windows bin

Re: [Numpy-discussion] Windows binary release?

2007-03-29 Thread Charles R Harris
On 3/28/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: Christopher Ball wrote: > Hi, > > I wonder if anyone can tell me when the next release is planned? Or > specifically, any idea when a new Windows binary installer will be > released? > I've been meaning to soon, but I've been stressed with

Re: [Numpy-discussion] use of concatenate with subclass of ndarray

2007-03-29 Thread Bryce Hendrix
I spoke too soon, this code fails with the example you gave: def test_concatenate(self): unit_ary_1 = UnitArray(numpy.array((1,2,3)), units=meters) unit_ary_2 = UnitArray(numpy.array((1,2,3)), units=meters) # create another instance with different units. This instance # is never used, but ca

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Fernando Perez
On 3/29/07, Steven H. Rogers <[EMAIL PROTECTED]> wrote: > Another option coming 'Real Soon Now` is `IPython1 > `. It's the enhanced Python > interactive shell with the added capability for distributed interactive > computing. This is moving slower than we'

[Numpy-discussion] Very odd problem of installation of matplotlib/numpy on XP

2007-03-29 Thread Giorgio Luciano
I've installed in my machine in the following order python 2.5 numpy 1.01 matplot lib 0.87 scipy 0.52 wxPython 2.8 with no problem I've also installed the same packages at home and in another two computer and everything went fine. The I was asked to install this "configuaration" in some classroom

Re: [Numpy-discussion] Further matrix oddities: no inner product

2007-03-29 Thread Sven Schreiber
Charles R Harris schrieb: > > Nope, vdot doesn't work for row and column vectors. So there is *no* > builtin inner product that works for matrices. I wonder if we should > have one, and if so, what it should be called. I think that vdot should > probably be modified to do the job. There is also

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Steven H. Rogers
Mandus wrote: > > > On 3/29/07, *Brad Malone* <[EMAIL PROTECTED] > > wrote: > > Hi, I use python for some fairly heavy scientific computations (at > least to be running on a single processor) and would like to use it > in parallel. I've seen some stuff onl

Re: [Numpy-discussion] Best way to run python parallel

2007-03-29 Thread Mandus
On 3/29/07, Brad Malone <[EMAIL PROTECTED]> wrote: Hi, I use python for some fairly heavy scientific computations (at least to be running on a single processor) and would like to use it in parallel. I've seen some stuff online about Parallel Python and mpiPy, but I don't know much about them. I