Re: [Numpy-discussion] Run length encoding of an ndarray

2007-10-02 Thread Stefan van der Walt
On Tue, Oct 02, 2007 at 01:36:02PM +0100, Michael Hoffman wrote: > I am trying to do a type of run-length encoding of a 2D array by axis. I > have an array of values arranged along two axes, state and position. > These are many (180, 3) uint8 arrays. > > I would like to have a list of tuples

Re: [Numpy-discussion] Run length encoding of an ndarray

2007-10-02 Thread Michael Hoffman
Michael Hoffman wrote: > I am trying to do a type of run-length encoding of a 2D array by axis. I > have an array of values arranged along two axes, state and position. > These are many (180, 3) uint8 arrays. > > I would like to have a list of tuples like > > (state, start_pos, end_pos, val

[Numpy-discussion] Run length encoding of an ndarray

2007-10-02 Thread Michael Hoffman
I am trying to do a type of run-length encoding of a 2D array by axis. I have an array of values arranged along two axes, state and position. These are many (180, 3) uint8 arrays. I would like to have a list of tuples like (state, start_pos, end_pos, values) only separating out a set of va