Re: [Numpy-discussion] numpy tests errors and failures

2013-06-03 Thread Tim Burgess
On Sat, 2013-06-01 at 20:09 -0400, Warren Weckesser wrote: > I'm using Ubuntu 12.04, so I suspect I won't be the only one who sees > these. > gcc on 12.04 (precise) should be 4.6.3 See http://packages.ubuntu.com/search?keywords=gcc&searchon=names&suite=precise§ion=all

[Numpy-discussion] ANN: PyTables 3.0

2013-06-03 Thread Antonio Valentino
=== Announcing PyTables 3.0.0 === We are happy to announce PyTables 3.0.0. PyTables 3.0.0 comes after about 5 years from the last major release (2.0) and 7 months since the last stable release (2.4.0). This is new major release and an important m

Re: [Numpy-discussion] easy way to collapse the last two dimension of an array?

2013-06-03 Thread Chao YUE
Thanks to the two of you!! Chao On Mon, Jun 3, 2013 at 11:53 AM, Sebastian Berg wrote: > On Mon, 2013-06-03 at 10:44 +0200, Chao YUE wrote: > > Dear all, > > > > I have an array with 4 dim: > > > > In [24]: dd.shape > > Out[24]: (12, 13, 120, 170) > > > > I would like to collapse the last two di

Re: [Numpy-discussion] About speed vs math...

2013-06-03 Thread Daπid
On 3 June 2013 08:33, David Cournapeau wrote: > (around 50 on my own machine, but that's platform > specific). In my machine, it is around 10. You also have to be aware of the data container: it is not the same to iterate over lists than over arrays. In [6]: a = np.arange(50) In [7]: %timeit np

Re: [Numpy-discussion] easy way to collapse the last two dimension of an array?

2013-06-03 Thread Sebastian Berg
On Mon, 2013-06-03 at 10:44 +0200, Chao YUE wrote: > Dear all, > > I have an array with 4 dim: > > In [24]: dd.shape > Out[24]: (12, 13, 120, 170) > > I would like to collapse the last two dim for applying np.sum(axis=-1) > If you use Numpy >= 1.7. you can also just use dd.sum(axis=(-1,-2)) -

Re: [Numpy-discussion] easy way to collapse the last two dimension of an array?

2013-06-03 Thread Robert Kern
On Mon, Jun 3, 2013 at 9:44 AM, Chao YUE wrote: > Dear all, > > I have an array with 4 dim: > > In [24]: dd.shape > Out[24]: (12, 13, 120, 170) > > I would like to collapse the last two dim for applying np.sum(axis=-1) > > In [25]: dd.reshape(12,13,-1).shape > Out[25]: (12, 13, 20400) > > is there

[Numpy-discussion] easy way to collapse the last two dimension of an array?

2013-06-03 Thread Chao YUE
Dear all, I have an array with 4 dim: In [24]: dd.shape Out[24]: (12, 13, 120, 170) I would like to collapse the last two dim for applying np.sum(axis=-1) In [25]: dd.reshape(12,13,-1).shape Out[25]: (12, 13, 20400) is there a more general way to do this? something like In [21]: dd.reshape(*dd

Re: [Numpy-discussion] About speed vs math...

2013-06-03 Thread Jerome Kieffer
On Mon, 3 Jun 2013 07:33:23 +0100 David Cournapeau wrote: > > While not surprising, I did not expect numpy to be so much slower (25x)... > It is a known limitation of numpy scalars. As soon as you use array > that are not tiny, the speed difference disappears and then favors > numpy arrays (aroun