Re: [Numpy-discussion] Fast decrementation of indices

2014-02-03 Thread Mads Ipsen
Hi, Thanks to everybody for all you valuable responses. This approach by Rick White seems to nail it all down: >> b = np.array([ >> [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, >> 11], >> [5, 6, 1, 0, 2, 7, 3, 8, 1, 4, 9, 2, 10, 5, 3, 4, 11, 0, 0, 1, 2, 3, 4, 5] >

[Numpy-discussion] ANN: Scipy 0.13.3 release

2014-02-03 Thread Ralf Gommers
Hi, I'm happy to announce the availability of the scipy 0.13.3 release. This is a bugfix only release; it contains fixes for regressions in ndimage and weave. Source tarballs can be found at https://sourceforge.net/projects/scipy/files/scipy/0.13.3/ and on PyPi. Release notes copied below, binari

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Charles R Harris
On Mon, Feb 3, 2014 at 2:32 PM, Travis Oliphant wrote: > Hey Sebastien, > > I didn't mean to imply that you would need to necessarily work on it. > But the work Jay has done could use review. > > There are also conversations to have about what to do to resolve the > ambiguity that led to the curr

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Travis Oliphant
Hey Sebastien, I didn't mean to imply that you would need to necessarily work on it. But the work Jay has done could use review. There are also conversations to have about what to do to resolve the ambiguity that led to the current behavior. Thank you or all the great work on the indexing code

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Sebastian Berg
On Sun, 2014-02-02 at 13:11 -0600, Travis Oliphant wrote: > This sounds like a great and welcome work and improvements. > > Does it make sense to also do something about the behavior of advanced > indexing when slices are interleaved between lists and integers. > > I know that jay borque has some

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Sebastian Berg
On Mon, 2014-02-03 at 00:41 -0800, Dinesh Vadhia wrote: > Does the numpy indexing refactorizing address the performance of fancy > indexing highlighted in wes mckinney's blog some years back - > http://wesmckinney.com/blog/?p=215 - where numpy.take() was shown to > be preferable than fancy indexing

Re: [Numpy-discussion] Fast decrementation of indices

2014-02-03 Thread Rick White
I think you'll find the algorithm below to be a lot faster, especially if the arrays are big. Checking each array index against the list of included or excluded elements is must slower than simply creating a secondary array and looking up whether the elements are included or not. b = np.array(

Re: [Numpy-discussion] Fast decrementation of indices

2014-02-03 Thread Eelco Hoogendoorn
Seconding Jaime; I use this trick in mesh manipulations a lot as well. There are a lot of graph-type manipulations you can express effectively in numpy using np.unique and related functionality. On Sun, Feb 2, 2014 at 11:57 PM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > Cannot test

Re: [Numpy-discussion] Fast decrementation of indices

2014-02-03 Thread Daπid
On 2 February 2014 20:58, Mads Ipsen wrote: > ie. bond 0 connects atoms 0 and 5, bond 1 connects atom 0 and 6, etc. In > practical examples, the list can be much larger (N > 100.000 connections. > Perhaps you should consider an alternative approach. You could consider it a graph, and you could

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Dinesh Vadhia
Does the numpy indexing refactorizing address the performance of fancy indexing highlighted in wes mckinney's blog some years back - http://wesmckinney.com/blog/?p=215 - where numpy.take() was shown to be preferable than fancy indexing? ___ NumPy-Discu