[MATRIX-SIG] Proposal: "Tables" in NumPy

Aaron Watters arw@dante.mh.lucent.com
Mon, 28 Jul 1997 10:00:23 -0400


I think you can approximate this, maybe, by cross
breeding kjbuckets.kjDict structures and arrays.
I'll have to have a think on this.

For a bit of a performance penalty (more loops in Python)
you could use standard python dictionaries.

On the matrix end I have this inkling that a "dual of
take" might come in handy here.  In fact, I'm pretty sure
of it.  Mind if I have a look at your code?

This is quite an exciting concept, I think.
-- Aaron Watters

ps: more generally, you'd like full integration of matrices
  in relational algebra-style tables (ie, sets of tuples).

----------
> From: Jim Phillips <jim@ks.uiuc.edu>
> To: matrix-sig@python.org
> I have written something like this in python, but only in two dimensions and  
> it is rather slow.  I would love to see a full N-dimension implementation as a  
> part of NumPy.  Perhaps a good interface would look something like this:
> 
> >>> a  # a 2-D table
> dogs   cats    birds
>  2      4       6
>  1      2       3
>  9      8       7
> >>> a['dogs']  # returns array (reference!)
> 2  1  9
> >>> a[:,1]  # returns table (reference!)
> dogs   cats    birds
>  1      2       3
> >>> a[('dogs','birds'),0:2]  # returns table (reference!)
> dogs   birds
>  2      6
>  1      3
> 
> This could really be a killer feature for data analysis since we would no  
> longer have to choose between C-style structures and FORTRAN-style arrays!
> 
> -Jim Phillips
> 
> _______________
> MATRIX-SIG  - SIG on Matrix Math for Python
> 
> send messages to: matrix-sig@python.org
> administrivia to: matrix-sig-request@python.org
> _______________
> 

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________