[Numpy-discussion] Permuting sparse arrays

2012-01-25 Thread Edward C. Jones
I have a vector of bits where there are many more zeros than one. I store the array as a sorted list of the indexes where the bit is one. If the bit array is (0, 1, 0, 0, 0, 1, 1), it is stored as (1, 5, 6). If the bit array, b, has length n, and p is a random permutation of arange(n), then

Re: [Numpy-discussion] Permuting sparse arrays

2012-01-25 Thread Robert Kern
On Wed, Jan 25, 2012 at 15:12, Edward C. Jones edcjo...@comcast.net wrote: I have a vector of bits where there are many more zeros than one.  I store the array as a sorted list of the indexes where the bit is one. If the bit array is (0, 1, 0, 0, 0, 1, 1), it is stored as (1, 5, 6). If the bit