Re: [Numpy-discussion] sparse array data

2012-05-05 Thread Wolfgang Kerzendorf
Hey guys, Thanks for all the suggestions. They seem already relatively involved, but I'll have a look at the table implementation. That seems to be the easiest of them all. Cheers Wolfgang On 2012-05-03, at 9:39 AM, Charles R Harris wrote: > > > On Thu, May 3, 2012 at 3:41 AM, Nathanie

Re: [Numpy-discussion] sparse array data

2012-05-03 Thread Charles R Harris
On Thu, May 3, 2012 at 3:41 AM, Nathaniel Smith wrote: > On Thu, May 3, 2012 at 4:44 AM, Charles R Harris > wrote: > > > > > > On Wed, May 2, 2012 at 3:20 PM, Nathaniel Smith wrote: > >> This coordinate format is also what's used by the MATLAB Tensor > >> Toolbox. They have a paper justifying t

Re: [Numpy-discussion] sparse array data

2012-05-03 Thread Nathaniel Smith
On Thu, May 3, 2012 at 4:44 AM, Charles R Harris wrote: > > > On Wed, May 2, 2012 at 3:20 PM, Nathaniel Smith wrote: >> This coordinate format is also what's used by the MATLAB Tensor >> Toolbox. They have a paper justifying this choice and describing some >> tricks for how to work with them: >>

Re: [Numpy-discussion] sparse array data

2012-05-03 Thread Dag Sverre Seljebotn
On 05/03/2012 03:25 AM, Travis Oliphant wrote: > > On May 2, 2012, at 5:28 PM, Stéfan van der Walt wrote: > >> On Wed, May 2, 2012 at 3:20 PM, Francesc Alted wrote: >>> On 5/2/12 4:07 PM, Stéfan van der Walt wrote: >>> Well, as the OP said, coo_matrix does not support dimensions larger than >>> 2,

Re: [Numpy-discussion] sparse array data

2012-05-03 Thread Dag Sverre Seljebotn
On 05/03/2012 06:27 AM, Travis Oliphant wrote: > > On May 2, 2012, at 10:03 PM, Stéfan van der Walt wrote: > >> On Wed, May 2, 2012 at 6:25 PM, Travis Oliphant wrote: >>> The only new principle (which is not strictly new --- but new to NumPy's >>> world-view) is using one (or more) fields of a st

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Travis Oliphant
On May 2, 2012, at 10:03 PM, Stéfan van der Walt wrote: > On Wed, May 2, 2012 at 6:25 PM, Travis Oliphant wrote: >> The only new principle (which is not strictly new --- but new to NumPy's >> world-view) is using one (or more) fields of a structured array as >> "synthetic dimensions" which rep

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Charles R Harris
On Wed, May 2, 2012 at 3:20 PM, Nathaniel Smith wrote: > On Wed, May 2, 2012 at 9:53 PM, Francesc Alted > wrote: > > On 5/2/12 11:16 AM, Wolfgang Kerzendorf wrote: > >> Hi all, > >> > >> I'm currently writing a code that needs three dimensional data (for the > physicists it's dimensions are atom

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Stéfan van der Walt
On Wed, May 2, 2012 at 6:25 PM, Travis Oliphant wrote: > The only new principle (which is not strictly new --- but new to NumPy's > world-view) is using one (or more) fields of a structured array as "synthetic > dimensions" which replace 1 or more of the raw table dimensions. Ah, thanks--that's

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Travis Oliphant
On May 2, 2012, at 5:28 PM, Stéfan van der Walt wrote: > On Wed, May 2, 2012 at 3:20 PM, Francesc Alted wrote: >> On 5/2/12 4:07 PM, Stéfan van der Walt wrote: >> Well, as the OP said, coo_matrix does not support dimensions larger than >> 2, right? > > That's just an implementation detail, I wo

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Nathaniel Smith
On Wed, May 2, 2012 at 11:26 PM, Francesc Alted wrote: > On 5/2/12 4:20 PM, Nathaniel Smith wrote: >> On Wed, May 2, 2012 at 9:53 PM, Francesc Alted  wrote: >>> On 5/2/12 11:16 AM, Wolfgang Kerzendorf wrote: Hi all, I'm currently writing a code that needs three dimensional data (for

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Francesc Alted
On 5/2/12 5:28 PM, Stéfan van der Walt wrote: > On Wed, May 2, 2012 at 3:20 PM, Francesc Alted wrote: >> On 5/2/12 4:07 PM, Stéfan van der Walt wrote: >> Well, as the OP said, coo_matrix does not support dimensions larger than >> 2, right? > That's just an implementation detail, I would imagine--I

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Stéfan van der Walt
On Wed, May 2, 2012 at 3:20 PM, Francesc Alted wrote: > On 5/2/12 4:07 PM, Stéfan van der Walt wrote: > Well, as the OP said, coo_matrix does not support dimensions larger than > 2, right? That's just an implementation detail, I would imagine--I'm trying to figure out if there is a new principle

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Francesc Alted
On 5/2/12 4:20 PM, Nathaniel Smith wrote: > On Wed, May 2, 2012 at 9:53 PM, Francesc Alted wrote: >> On 5/2/12 11:16 AM, Wolfgang Kerzendorf wrote: >>> Hi all, >>> >>> I'm currently writing a code that needs three dimensional data (for the >>> physicists it's dimensions are atom, ion, level). The

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Francesc Alted
On 5/2/12 4:07 PM, Stéfan van der Walt wrote: > Hi Francesc > > On Wed, May 2, 2012 at 1:53 PM, Francesc Alted wrote: >> and add another one for the actual values of the array. For a 3-D >> sparse array, this looks like: >> >> dim0 | dim1 | dim2 | value >> == >> 0 |

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Nathaniel Smith
On Wed, May 2, 2012 at 9:53 PM, Francesc Alted wrote: > On 5/2/12 11:16 AM, Wolfgang Kerzendorf wrote: >> Hi all, >> >> I'm currently writing a code that needs three dimensional data (for the >> physicists it's dimensions are atom, ion, level). The problem is that not >> all combinations do exis

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Stéfan van der Walt
Hi Francesc On Wed, May 2, 2012 at 1:53 PM, Francesc Alted wrote: > and add another one for the actual values of the array.  For a 3-D > sparse array, this looks like: > > dim0 | dim1 | dim2 | value > == >    0 |   0  |   0  | val0 >    0 |  10  | 100  | val1 >   20 |   5

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Francesc Alted
On 5/2/12 11:16 AM, Wolfgang Kerzendorf wrote: > Hi all, > > I'm currently writing a code that needs three dimensional data (for the > physicists it's dimensions are atom, ion, level). The problem is that not all > combinations do exist (a sparse array). Sparse matrices in scipy only deal > with

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Frédéric Bastien
what about numpy.ma? Those are marked array. But they won't be the fastest. Fred On Wed, May 2, 2012 at 12:16 PM, Wolfgang Kerzendorf wrote: > Hi all, > > I'm currently writing a code that needs three dimensional data (for the > physicists it's dimensions are atom, ion, level). The problem is t