Finding min/max of numarray RecordArray

Camp Fire Camp.Fire at camp.fire
Tue Nov 2 00:37:52 EST 2004


If you have a really huge RecordArray that is memmapped, is this the
right way to find the min of it:

- Get the minimum value of each field (requires a full scan)

- Use the "equal" ufunc to create an array of 1's and 0's corresponding
  to which elements are equal to the min for each field (requires a full
scan)

- Go through these arrays of 1's and 0's and do a logical AND operation.

   The indices that remain "1" are the mins.


i.e.

field1     field2     field3
[ 0           [1          [0
  1            1           1
  1]            0]           1]

This would make the second row the minimum of the RecordArray, because
it is the only row with 1's for all fields.



Is there a better way to do this?






More information about the Python-list mailing list