[Numpy-discussion] matlab for numpy users

2009-09-16 Thread Christian K .
Hi, this is probaby an unusual question here from someone used to numpy who is forced to work with matlab and it is not exactly the right place to ask. Sorry for that. Is there something like broadcasting in matlab? E.g. how can I do something like that: a = ones((50,50), dtype=float) time =

Re: [Numpy-discussion] array multiplication

2009-09-16 Thread Nadav Horesh
Or np.multiply.outer(a,b) Nadav -הודעה מקורית- מאת: numpy-discussion-boun...@scipy.org בשם Robert Kern נשלח: ה 17-ספטמבר-09 00:40 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] array multiplication 2009/9/16 Ernest Adrogu? : > Hi, > > I have two 1-d arrays (a and b)

Re: [Numpy-discussion] Simple pattern recognition

2009-09-16 Thread David Warde-Farley
On 16-Sep-09, at 8:22 PM, Gökhan Sever wrote: > Hello all, > > I want to be able to count predefined simple rectangle shapes on an > image as > shown like in this one: http://img7.imageshack.us/img7/2327/particles.png > > Which is in my case to count all the blue pixels (they are ice-snow > fl

Re: [Numpy-discussion] Simple pattern recognition

2009-09-16 Thread Alan G Isaac
On 9/16/2009 8:22 PM, Gökhan Sever wrote: > I want to be able to count predefined simple rectangle shapes on an > image as shown like in this one: > http://img7.imageshack.us/img7/2327/particles.png ch.9 of http://www.amazon.com/Beginning-Python-Visualization-Transformation-Professionals/dp/14302

[Numpy-discussion] Simple pattern recognition

2009-09-16 Thread Gökhan Sever
Hello all, I want to be able to count predefined simple rectangle shapes on an image as shown like in this one: http://img7.imageshack.us/img7/2327/particles.png Which is in my case to count all the blue pixels (they are ice-snow flake shadows in reality) in one of the column. What is the way to

Re: [Numpy-discussion] array multiplication

2009-09-16 Thread Robert Kern
2009/9/16 Ernest Adrogué : > Hi, > > I have two 1-d arrays (a and b), and I want to create a > third 2-d array, whose rows are of the form a[i]*b: > > c = np.zeros((len(a),b)) > > c[0] = a[0]*b > c[1] = a[1]*b > . > . > . > > Is there an easy way to do this (e.g, without a loop)? c = a[:,np.newaxi

[Numpy-discussion] array multiplication

2009-09-16 Thread Ernest Adrogué
Hi, I have two 1-d arrays (a and b), and I want to create a third 2-d array, whose rows are of the form a[i]*b: c = np.zeros((len(a),b)) c[0] = a[0]*b c[1] = a[1]*b . . . Is there an easy way to do this (e.g, without a loop)? Thanks! -- Ernest ___ N

Re: [Numpy-discussion] NameError: global name 'matrix' is not defined

2009-09-16 Thread Nils Wagner
On Wed, 16 Sep 2009 11:41:15 -0500 Robert Kern wrote: > On Wed, Sep 16, 2009 at 11:39, Nils >Wagner wrote: >> Ran 2235 tests in 25.593s >> >> FAILED (KNOWNFAIL=1, errors=28, failures=1) >> >failures=1> > import numpy > numpy.__version__ >> '1.4.0.dev7400' >> >> =

Re: [Numpy-discussion] NameError: global name 'matrix' is not defined

2009-09-16 Thread Robert Kern
On Wed, Sep 16, 2009 at 11:39, Nils Wagner wrote: > Ran 2235 tests in 25.593s > > FAILED (KNOWNFAIL=1, errors=28, failures=1) > import numpy numpy.__version__ > '1.4.0.dev7400' > > == > ERROR: test_basic (test_defmatrix.

[Numpy-discussion] NameError: global name 'matrix' is not defined

2009-09-16 Thread Nils Wagner
Ran 2235 tests in 25.593s FAILED (KNOWNFAIL=1, errors=28, failures=1) >>> import numpy >>> numpy.__version__ '1.4.0.dev7400' == ERROR: test_basic (test_defmatrix.TestAlgebra) -

Re: [Numpy-discussion] Moved matrix class into separate module

2009-09-16 Thread Christopher Hanley
My apologizes. I had remembered to remove the previous build directory but not the target installation directory. After having removed all traces of the previous numpy installation and do a clean install I receive no new errors. Sorry for the false alarm. Chris -- Christopher Hanley Se

Re: [Numpy-discussion] Moved matrix class into separate module

2009-09-16 Thread David Cournapeau
On Thu, Sep 17, 2009 at 12:32 AM, Christopher Hanley wrote: > Hi, > > When I try running the tests on a fresh build from the trunk I receive > 28 errors.  Most of the errors are of the form: > > "NameError: global name 'matrix' is not defined" > > It looks like  there was some change to the numpy

Re: [Numpy-discussion] Moved matrix class into separate module

2009-09-16 Thread Christopher Hanley
Hi, When I try running the tests on a fresh build from the trunk I receive 28 errors. Most of the errors are of the form: "NameError: global name 'matrix' is not defined" It looks like there was some change to the numpy namespace. I can provide a full listing of the unit test errors if de

Re: [Numpy-discussion] how can we concatenate structured arrays ?

2009-09-16 Thread Skipper Seabold
On Wed, Sep 16, 2009 at 5:10 AM, wrote: > On Wed, Sep 16, 2009 at 4:42 AM, Pierre GM wrote: >> >> On Sep 16, 2009, at 4:25 AM, josef.p...@gmail.com wrote: >> >>> I have two structured arrays of different types. How can I >>> horizontally concatenate the two arrays? Is there a direct way, or do >

Re: [Numpy-discussion] how can we concatenate structured arrays ?

2009-09-16 Thread josef . pktd
On Wed, Sep 16, 2009 at 4:42 AM, Pierre GM wrote: > > On Sep 16, 2009, at 4:25 AM, josef.p...@gmail.com wrote: > >> I have two structured arrays of different types. How can I >> horizontally concatenate the two arrays? Is there a direct way, or do >> I need to start from scratch? > > Check numpy.l

Re: [Numpy-discussion] how can we concatenate structured arrays ?

2009-09-16 Thread josef . pktd
On Wed, Sep 16, 2009 at 4:25 AM, wrote: > I have two structured arrays of different types. How can I > horizontally concatenate the two arrays? Is there a direct way, or do > I need to start from scratch? > > nobs = 10 > testdata = np.random.randint(3, > size=(nobs,4)).view([('a',int),('b',int),(

Re: [Numpy-discussion] how can we concatenate structured arrays ?

2009-09-16 Thread Pierre GM
On Sep 16, 2009, at 4:25 AM, josef.p...@gmail.com wrote: > I have two structured arrays of different types. How can I > horizontally concatenate the two arrays? Is there a direct way, or do > I need to start from scratch? Check numpy.lib.recfunctions, that should get you started. __

[Numpy-discussion] how can we concatenate structured arrays ?

2009-09-16 Thread josef . pktd
I have two structured arrays of different types. How can I horizontally concatenate the two arrays? Is there a direct way, or do I need to start from scratch? nobs = 10 testdata = np.random.randint(3, size=(nobs,4)).view([('a',int),('b',int),('c',int),('d',int)]) testdatacont = np.random.normal( s

[Numpy-discussion] Moved matrix class into separate module

2009-09-16 Thread David Cournapeau
Hi, I just wanted to mention I integrated a patch from some time ago to make numpy.core independent from other numpy modules. This is really useful when working on involved changes at the C level. This meant moving some stuff around, in particular the matrix class and utilities is now into numpy.m