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 Oliphanttra...@continuum.io wrote: The only new principle (which is not strictly new --- but new to NumPy's world-view) is using one (or more)

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 Altedfranc...@continuum.io 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

Re: [Numpy-discussion] sparse array data

2012-05-03 Thread Nathaniel Smith
On Thu, May 3, 2012 at 4:44 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, May 2, 2012 at 3:20 PM, Nathaniel Smith n...@pobox.com 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

Re: [Numpy-discussion] sparse array data

2012-05-03 Thread Charles R Harris
On Thu, May 3, 2012 at 3:41 AM, Nathaniel Smith n...@pobox.com wrote: On Thu, May 3, 2012 at 4:44 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, May 2, 2012 at 3:20 PM, Nathaniel Smith n...@pobox.com wrote: This coordinate format is also what's used by the MATLAB Tensor

[Numpy-discussion] sparse array data

2012-05-02 Thread Wolfgang Kerzendorf
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 two dimensions. The operations that I need to do on

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 wkerzend...@gmail.com wrote: Hi all, I'm currently writing a code that needs three dimensional data (for the physicists it's dimensions are atom, ion,

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 two

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 franc...@continuum.io 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  |

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Nathaniel Smith
On Wed, May 2, 2012 at 9:53 PM, Francesc Alted franc...@continuum.io 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

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 Altedfranc...@continuum.io 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 ==

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 Altedfranc...@continuum.io 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,

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 franc...@continuum.io 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

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 Altedfranc...@continuum.io 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

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Nathaniel Smith
On Wed, May 2, 2012 at 11:26 PM, Francesc Alted franc...@continuum.io wrote: On 5/2/12 4:20 PM, Nathaniel Smith wrote: On Wed, May 2, 2012 at 9:53 PM, Francesc Altedfranc...@continuum.io  wrote: On 5/2/12 11:16 AM, Wolfgang Kerzendorf wrote: Hi all, I'm currently writing a code that needs

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 franc...@continuum.io 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

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 tra...@continuum.io 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,

Re: [Numpy-discussion] sparse array data

2012-05-02 Thread Charles R Harris
On Wed, May 2, 2012 at 3:20 PM, Nathaniel Smith n...@pobox.com wrote: On Wed, May 2, 2012 at 9:53 PM, Francesc Alted franc...@continuum.io 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

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 tra...@continuum.io 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