You can subscribe to this list here.
2000 |
Jan
(8) |
Feb
(49) |
Mar
(48) |
Apr
(28) |
May
(37) |
Jun
(28) |
Jul
(16) |
Aug
(16) |
Sep
(44) |
Oct
(61) |
Nov
(31) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(56) |
Feb
(54) |
Mar
(41) |
Apr
(71) |
May
(48) |
Jun
(32) |
Jul
(53) |
Aug
(91) |
Sep
(56) |
Oct
(33) |
Nov
(81) |
Dec
(54) |
2002 |
Jan
(72) |
Feb
(37) |
Mar
(126) |
Apr
(62) |
May
(34) |
Jun
(124) |
Jul
(36) |
Aug
(34) |
Sep
(60) |
Oct
(37) |
Nov
(23) |
Dec
(104) |
2003 |
Jan
(110) |
Feb
(73) |
Mar
(42) |
Apr
(8) |
May
(76) |
Jun
(14) |
Jul
(52) |
Aug
(26) |
Sep
(108) |
Oct
(82) |
Nov
(89) |
Dec
(94) |
2004 |
Jan
(117) |
Feb
(86) |
Mar
(75) |
Apr
(55) |
May
(75) |
Jun
(160) |
Jul
(152) |
Aug
(86) |
Sep
(75) |
Oct
(134) |
Nov
(62) |
Dec
(60) |
2005 |
Jan
(187) |
Feb
(318) |
Mar
(296) |
Apr
(205) |
May
(84) |
Jun
(63) |
Jul
(122) |
Aug
(59) |
Sep
(66) |
Oct
(148) |
Nov
(120) |
Dec
(70) |
2006 |
Jan
(460) |
Feb
(683) |
Mar
(589) |
Apr
(559) |
May
(445) |
Jun
(712) |
Jul
(815) |
Aug
(663) |
Sep
(559) |
Oct
(930) |
Nov
(373) |
Dec
|
From: Gary R. <gr...@bi...> - 2006-06-24 03:44:04
|
One possible starting point for this would be Chris Stawarz's i2py translator which attempts to do this for IDL <http://software.pseudogreen.org/i2py/>. It might be possible to build on this by getting it working for current numpy. The production rules for MATLAB might be gleaned from Octave. Gary R. Mathew Yeates wrote: >> I'm porting by hand. It does not seem easy to me. And even if it were > Ah. Do I detect a dare? Could start first by using Octaves matlab parser. |
From: Travis O. <oli...@ie...> - 2006-06-24 03:07:47
|
John Parejko wrote: > Greetings! I'm having trouble using records. I'm not sure whether to > report this as a bug, but it certainly isn't a feature! I would like to be > able to iterate over the individual rows in a record array, like so: > That is probably reasonable, but as yet is unsupported. You can do x[0].item() to get a tuple that can be iterated over. -Travis |
From: John P. <par...@sp...> - 2006-06-24 01:04:56
|
Greetings! I'm having trouble using records. I'm not sure whether to report this as a bug, but it certainly isn't a feature! I would like to be able to iterate over the individual rows in a record array, like so: >>> import numpy.core.records as rec >>> x=rec.array([[1,1.1,'1.0'],[2,2.2,'2.0']], formats='i4,f8,a4',names=['i','f','s']) >>> type(x[0]) <class 'numpy.core.records.record'> >>> x[0].tolist() Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: can't convert a 0-d array to a list >>> [i for i in x[0]] Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: iteration over non-sequence Am I going about this wrong? I would think I should be able to loop over an individual row in a record array, or turn it into a list. For the latter, I wrote my own thing, but tolist() should work by itself. Note that in rec2list, I need to use range(len(line)) because the list comprehension doesn't work correctly: def rec2list(line): """Turns a single element record array into a list.""" return [line[i] for i in xrange(len(line))] #... I will file a bug, unless someone tells me I'm going about this the wrong way. Thanks for your help John -- ************************* John Parejko Department of Physics and Astronomy Drexel University Philadelphia, PA ************************** |
From: Ryan K. <rya...@gm...> - 2006-06-23 23:45:57
|
If people could post lines of Matlab code and proposed numpy could, we could try some regexp's that could do some of this. Ryan On 6/23/06, Keith Goodman <kwg...@gm...> wrote: > On 6/23/06, Mathew Yeates <my...@jp...> wrote: > > > > > > > > I'm porting by hand. It does not seem easy to me. And even if it were > > Ah. Do I detect a dare? Could start first by using Octaves matlab parser. > > (Let me help you recruit people to do the work) > > "There is no way in the world that this will work!" > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Travis O. <oli...@ee...> - 2006-06-23 22:18:15
|
Tom Loredo wrote: >Hi Travis, > > > >>I'm actually preparing the 1.0 release version, instead. >> >>Here's the latest, though... >> >> > >Thanks! > >I hate to be a nuisance about this, but what's the status >of the latest releases of numpy/scipy? Numpy 0.9.8 gives >a segfault on my FC3 box. > NumPy 0.9.8 should be fine except for one test. That tests gives a segfault because of a problem with Python that was fixed a while ago. As long as you don't create the new complex array scalars (i.e. using cdouble(10), complex128(3), etc.) you should be fine with all code running NumPy 0.9.8. Just delete the file site-packages/numpy/core/tests/test_scalarmath.py to get the tests to run. >I waited till today to try the >SVN version (per your scipy-dev post) and just installed >rev 2669. It passes the numpy tests--good!---but when I >followed it with an install of scipy-0.4.9, importing >scipy gives an error: > >import linsolve.umfpack -> failed: cannot import name ArrayType > >When you mentioned that the SVN numpy now worked with scipy, > > >was it only with SVN scipy? > > Yes. You need to re-compile scipy to work with SVN NumPy. Usually Ed Schofield has been helping release SciPy for each new NumPy release to make installation easier. >I'm asking all this, partly for my own info, but also because >last week at an astrostatistics conference I was given a long >slot of time where I gave a pretty hard sell of numpy/scipy. >I'm imagining all these people going home and installing the >latest releases and cursing me under their breaths! > >Is it just my FC3 box having issues with the current releases? >If not, I think something should be said on the download page >(e.g., maybe encourage people to use SVN for certain platforms). > > It's just the one test that's a problem (my system was more forgiving and didn't segfault so I didn't catch the problem). I doubt people are using the construct that is causing the problems much anway -- it's a subtle bug that was in Python when a C-type inherited from the Python complex type. I'd probably recommend using SVN NumPy/SciPy if you are comfortable with compilation because it's the quickest way to get bug-fixes. But, some like installed packages. That's why we are pushing to get 1.0 done as quickly as is reasonable. |
From: Alan G I. <ai...@am...> - 2006-06-23 21:26:47
|
> Alan G Isaac wrote:=20 >> I can roughly understand why a.ravel() returns a matrix;=20 >> but is there a good reason to forbid truly flattening the matrix?=20 On Fri, 23 Jun 2006, Travis Oliphant apparently wrote:=20 > Because matrices are never 1-d. This is actually pretty=20 > consistent behavior.=20 Yes; that's why I can understand ravel. But I was referring to flat with the question. On Fri, 23 Jun 2006, Travis Oliphant apparently wrote:=20 > I think you are right that this is a bug, though. Because=20 > __array__() (which is where the behavior comes from)=20 > should return a base-class array (not a sub-class).=20 Thanks for fixing this!! Alan |
From: Travis O. <oli...@ee...> - 2006-06-23 21:19:25
|
Alan G Isaac wrote: >I do not understand how to think about this: > > >>> x=arange(3).flat > >>> x > <numpy.flatiter object at 0x01BD0C58> > >>> x>2 > True > >>> x>10 > True > >Why? (I realize this behaves like xrange, >so this may not be a numpy question, >but I do not understand that behavior either.) > > The flatiter object didn't have comparisons implemented so I guess it was using some default implementation. This is quite confusing and option 2 does make sense (an array of resulting comparisions is returned). Thus now: >> x=arange(3).flat >>> x>2 array([False, False, False], dtype=bool) >>> x>1 array([False, False, True], dtype=bool) >>> x>0 array([False, True, True], dtype=bool) -Travis |
From: Michael F. <mp...@ca...> - 2006-06-23 21:16:06
|
Ping! Is anyone else seeing this? It should be easy to test. If so, I think it's a bug. Best, Mike On Jun 21, 2006, at 9:39 PM, Michael Fitzgerald wrote: > > Hello all, > > I'm encountering some (relatively new?) behavior with masked arrays > that > strikes me as bizarre. Raising zero to a floating-point value is > triggering > a mask to be set, even though the result should be well-defined. > When using > fixed-point integers for powers, everything works as expected. I'm > seeing > this with both numarray and numpy. Take the case of 0**1, > illustrated below: > >>>> import numarray as n1 >>>> import numarray.ma as n1ma >>>> n1.array(0.)**1 > array(0.0) >>>> n1.array(0.)**1. > array(0.0) >>>> n1ma.array(0.)**1 > array(0.0) >>>> n1ma.array(0.)**1. > array(data = > [1.0000000200408773e+20], > mask = > 1, > fill_value=[ 1.00000002e+20]) > >>>> import numpy as n2 >>>> import numpy.core.ma as n2ma >>>> n2.array(0.)**1 > array(0.0) >>>> n2.array(0.)**1. > array(0.0) >>>> n2ma.array(0.)**1 > array(0.0) >>>> n2ma.array(0.)**1. > array(data = > 1e+20, > mask = > True, > fill_value=1e+20) > > I've been using python v2.3.5 & v.2.4.3, numarray v1.5.1, and numpy > v0.9.8, > and tested this on an x86 Debian box and a PPC OSX box. It may be > the case > that this issue has manifested in the past several months, as it's > causing a > new problem with some of my older code. Any thoughts? > > Thanks in advance, > Mike > > > All the advantages of Linux Managed Hosting--Without the Cost and > Risk! > Fully trained technicians. The highest number of Red Hat > certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion |
From: Travis O. <oli...@ee...> - 2006-06-23 21:08:27
|
Travis Oliphant wrote: >Alan G Isaac wrote: > > >> >> >I think you are right that this is a bug, though. Because __array__() >(which is where the behavior comes from) should return a base-class >array (not a sub-class). > > This is fixed in SVN. -Travis |
From: Travis O. <oli...@ee...> - 2006-06-23 21:01:11
|
Alan G Isaac wrote: >>Alan G Isaac wrote: >> >> >>>Why is a.flat not the same as a.A.flat? >>> >>> > > >On Fri, 23 Jun 2006, Travis Oliphant apparently wrote: > > >>It is the same object except for the pointer to the >>underlying array. When asarray(a.flat) get's called it >>looks to the underlying array to get the sub-class and >>constructs that sub-class (and matrices can never be 1-d). >>Thus, it's a "feature" >> >> > > >I doubt I will prove the only one to stumble over this. > >I can roughly understand why a.ravel() returns a matrix; >but is there a good reason to forbid truly flattening the matrix? > > Because matrices are never 1-d. This is actually pretty consistent behavior. >My instincts are that a flatiter object should not have this >hidden "feature": flatiter objects should produce >a consistent behavior in all settings, regardless of the >underlying array. Anything else will prove too surprising. > > I think you are right that this is a bug, though. Because __array__() (which is where the behavior comes from) should return a base-class array (not a sub-class). -Travis |
From: Alan G I. <ai...@am...> - 2006-06-23 20:52:49
|
> Alan G Isaac wrote:=20 >> Why is a.flat not the same as a.A.flat?=20 On Fri, 23 Jun 2006, Travis Oliphant apparently wrote:=20 > It is the same object except for the pointer to the=20 > underlying array. When asarray(a.flat) get's called it=20 > looks to the underlying array to get the sub-class and=20 > constructs that sub-class (and matrices can never be 1-d). =20 > Thus, it's a "feature"=20 I doubt I will prove the only one to stumble over this. I can roughly understand why a.ravel() returns a matrix; but is there a good reason to forbid truly flattening the matrix? My instincts are that a flatiter object should not have this=20 hidden "feature": flatiter objects should produce=20 a consistent behavior in all settings, regardless of the=20 underlying array. Anything else will prove too surprising. fwiw, Alan |
From: Keith G. <kwg...@gm...> - 2006-06-23 20:42:20
|
On 6/23/06, Mathew Yeates <my...@jp...> wrote: > > > > > I'm porting by hand. It does not seem easy to me. And even if it were > Ah. Do I detect a dare? Could start first by using Octaves matlab parser. (Let me help you recruit people to do the work) "There is no way in the world that this will work!" |
From: Mathew Y. <my...@jp...> - 2006-06-23 20:22:16
|
> > I'm porting by hand. It does not seem easy to me. And even if it were Ah. Do I detect a dare? Could start first by using Octaves matlab parser. |
From: Travis O. <oli...@ee...> - 2006-06-23 19:19:48
|
Alan G Isaac wrote: >>Alan G Isaac wrote: >> >> >>>Hmm. One would think that diag() would accept a flatiter >>>object, but it does not. Shouldn't it?? >>> >>> > > >On Fri, 23 Jun 2006, Travis Oliphant apparently wrote: > > >>It doesn't? >>try: >>a = rand(3,4) >>diag(a.flat).shape >> >> > >OK, but then try: > > >>>>a=N.mat(a) >>>>N.diag(a.flat).shape >>>> >>>> >(1,) > >Why is a.flat not the same as a.A.flat? > > It is the same object except for the pointer to the underlying array. When asarray(a.flat) get's called it looks to the underlying array to get the sub-class and constructs that sub-class (and matrices can never be 1-d). Thus, it's a "feature" -Travis |
From: Alan G I. <ai...@am...> - 2006-06-23 18:22:09
|
> Alan G Isaac wrote:=20 >> Hmm. One would think that diag() would accept a flatiter=20 >> object, but it does not. Shouldn't it??=20 On Fri, 23 Jun 2006, Travis Oliphant apparently wrote:=20 > It doesn't?=20 > try:=20 > a =3D rand(3,4)=20 > diag(a.flat).shape=20 OK, but then try: >>> a=3DN.mat(a) >>> N.diag(a.flat).shape (1,) Why is a.flat not the same as a.A.flat? Alan Isaac |
From: Keith G. <kwg...@gm...> - 2006-06-23 18:01:32
|
On 6/23/06, Mathew Yeates <my...@jp...> wrote: > This is probably in an FAQ somewhere but ..... > > Is there a tool out there for translating Matlab to Numeric? I found a > 1999 posting by Travis asking the same thing! It doesn't seem like it > would be all THAT difficult to write. I'm porting by hand. It does not seem easy to me. And even if it were easy, both Matlab and NumPy are moving targets. So it would difficult to maintain. |
From: Mathew Y. <my...@jp...> - 2006-06-23 17:56:29
|
This is probably in an FAQ somewhere but ..... Is there a tool out there for translating Matlab to Numeric? I found a 1999 posting by Travis asking the same thing! It doesn't seem like it would be all THAT difficult to write. Mathew |
From: Travis O. <oli...@ee...> - 2006-06-23 17:14:27
|
Ed Schofield wrote: >On 22/06/2006, at 12:40 AM, Bill Baxter wrote: > > > >>Actually I think using mat() (just an alias for the matrix >>constructor) is a bad way to do it. That mat() (and most others on >>that page) should probably be replaced with asmatrix() to avoid the >>copy. >> >> > >Perhaps the 'mat' function should become an alias for 'asmatrix'. >I've thought this for a while. Then code and documentation like this >page could remain short and simple without incurring the performance >penalty. > > I wanted this too a while back but when I tried it a lot of code broke because there were quite a few places (in SciPy and NumPy) that were using the fact that mat returned a copy of the array. -Travis |
From: Travis O. <oli...@ee...> - 2006-06-23 17:11:50
|
Alan G Isaac wrote: >On Fri, 23 Jun 2006, Keith Goodman apparently wrote: > > >>my x is a Nx1 matrix. I can't get it to work with matrices. >> >> > >Hmm. One would think that diag() would accept a flatiter >object, but it does not. Shouldn't it?? > > It doesn't? try: a = rand(3,4) diag(a.flat).shape which prints (12,12) for me. Also: >>> a = ones((2,3)) >>> diag(a.flat) array([[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1]]) |
From: Alan G I. <ai...@am...> - 2006-06-23 16:14:54
|
On Fri, 23 Jun 2006, Alan G Isaac apparently wrote:=20 > you can squeeze x=20 True, but a silly solution. Alan |
From: David D. <dav...@lo...> - 2006-06-23 16:09:09
|
On Fri, Jun 23, 2006 at 07:55:47AM -0700, Keith Goodman wrote: > On 6/23/06, Sven Schreiber <sve...@gm...> wrote: > > Keith Goodman schrieb: > > > How do I make a NxN diagonal matrix with a Nx1 column vector x along > > > the diagonal? > > > > > > > >>> help(n.diag) > > Help on function diag in module numpy.lib.twodim_base: > > > > diag(v, k=3D0) > > returns the k-th diagonal if v is a array or returns a array > > with v as the k-th diagonal if v is a vector. >=20 > I tried >=20 > >> x =3D rand(3,1) >=20 > >> diag(x) > array([ 0.87113114]) >=20 > Isn't rand(3,1) a vector? No: In [13]: rand(3).shape =20 Out[13]: (3,) In [14]: rand(3,1).shape Out[14]: (3, 1) A "vector" is an array with only one dimension. Here, you have a 3x1 "matrix"... >=20 > Off list I was given the example: > x=3Drand(3) > diag(3) So you've got the solution! > That works. But my x is a Nx1 matrix. I can't get it to work with matrice= s. ??? Don't understand what you cannot make work, here. In [15]: x=3Drand(3,1) =20 In [18]: diag(x[:,0]) Out[18]:=20 array([[ 0.2287158 , 0. , 0. ], [ 0. , 0.50571537, 0. ], [ 0. , 0. , 0.72304857]]) What else would you like? David > Joris: The Numpy Example List looks good. I hadn't come across that befor= e. >=20 David Douard LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian : http://www.logilab.fr/formations D=E9veloppement logiciel sur mesure : http://www.logilab.fr/services Informatique scientifique : http://www.logilab.fr/science |
From: Alan G I. <ai...@am...> - 2006-06-23 15:55:33
|
On Fri, 23 Jun 2006, Keith Goodman apparently wrote:=20 > my x is a Nx1 matrix. I can't get it to work with matrices.=20 Hmm. One would think that diag() would accept a flatiter=20 object, but it does not. Shouldn't it?? But anyway, you can squeeze x: >>> x matrix([[ 0.46474951], [ 0.0688041 ], [ 0.61141623]]) >>> y=3DN.diag(N.squeeze(x.A)) >>> y array([[ 0.46474951, 0. , 0. ], [ 0. , 0.0688041 , 0. ], [ 0. , 0. , 0.61141623]]) hth, Alan Isaac |
From: Alan G I. <ai...@am...> - 2006-06-23 15:42:41
|
On Fri, 23 Jun 2006, Sven Schreiber apparently wrote:=20 >>>> help(n.diag)=20 > Help on function diag in module numpy.lib.twodim_base:=20 > diag(v, k=3D0)=20 > returns the k-th diagonal if v is a array or returns a array=20 > with v as the k-th diagonal if v is a vector.=20 That is pretty damn obscure. Apparently Travis's new doc string did not survive? The Numpy book says: diag (v, k=3D0) Return the kth diagonal if v is a 2-d array, or returns=20 an array with v as the kth diagonal if v is a 1-d array. That is better but not great. I think what is wanted is: diag (v, k=3D0) If v is a 2-d array: return a copy of the kth diagonal of v (as a 1-d array). If v is a 1-d array: return a 2-d array with a copy of v as the kth diagonal=20 (and zeros elsewhere). fwiw, Alan Isaac PS As a response to the question, it might be worth noting=20 the following. >>> y=3DN.zeros((5,5)) >>> values=3DN.arange(1,6) >>> indices=3Dslice(0,25,6) >>> y.flat[indices]=3Dvalues >>> y array([[1, 0, 0, 0, 0], [0, 2, 0, 0, 0], [0, 0, 3, 0, 0], [0, 0, 0, 4, 0], [0, 0, 0, 0, 5]]) Generalizing we end up with the following (from pyGAUSS): def diagrv(x,v,copy=3DTrue): =09if copy: x =3D numpy.matrix( x, copy=3DTrue ) =09else: x =3D numpy.matrix( x, copy=3DFalse ) =09stride =3D 1 + x.shape[1] =09x.flat[ slice(0,x.size,stride) ] =3D v return x |
From: Sven S. <sve...@gm...> - 2006-06-23 15:18:15
|
Keith Goodman schrieb: > > Isn't rand(3,1) a vector? afaik not in numpy's terms, because two numbers are given for the dimensions -- I also struggle with that, because I'm a matrix guy like you ;-) > > Off list I was given the example: > x=rand(3) > diag(3) > > That works. But my x is a Nx1 matrix. I can't get it to work with matrices. > ok, good point; with your x then diag(x.A[:,0]) should work, although it's not very pretty. Maybe there are better ways, but I agree it would be nice to be able to use matrices directly. -sven |
From: Keith G. <kwg...@gm...> - 2006-06-23 14:55:51
|
On 6/23/06, Sven Schreiber <sve...@gm...> wrote: > Keith Goodman schrieb: > > How do I make a NxN diagonal matrix with a Nx1 column vector x along > > the diagonal? > > > > >>> help(n.diag) > Help on function diag in module numpy.lib.twodim_base: > > diag(v, k=0) > returns the k-th diagonal if v is a array or returns a array > with v as the k-th diagonal if v is a vector. I tried >> x = rand(3,1) >> diag(x) array([ 0.87113114]) Isn't rand(3,1) a vector? Off list I was given the example: x=rand(3) diag(3) That works. But my x is a Nx1 matrix. I can't get it to work with matrices. Joris: The Numpy Example List looks good. I hadn't come across that before. |