[MATRIX-SIG] cmp?

Jim Hugunin hugunin@javanet.com
Tue, 17 Jun 1997 11:12:31 -0400


> Is there any problem with lexicographic ordering?  I understand
> that cmp() may have no reasonable interpretation from a
> numeric perspective per se, but you'd still like to be able to do
> "row sorts".

Tim H. did a good job of explaining why this isn't done.  Because it's
unlikely that cmp will be able to return an array of booleans anytime soon,
what I really want to do is raise an exception here.  In order to avoid any
problems with backwards incompatibility I've decided to make cmp as useless
as possible for arrays until I can have it start raising exceptions.

> >From a database perspective I'd like to implement the
> analogue of SQL "group by", ie, as in
> 
> select a,b, avg(d+e)
> from array1
> group by a,b

For those of us with minimal SQL knowledge, could you go into a few more
details on what "group by" is supposed to do?  A concrete example of where
you'd like to do this (on a database of floats I assume?) would be helpful.

I have the strong feeling that either you really shouldn't be using NumPy
to do this, or you're missing some obvious better approach.  Of course,
this might just be my general desire not to admit that a lexocographic cmp
could possibly be valuable for arrays.

Please send more info - Jim

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

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