Finding min/max of numarray RecordArray

C

Camp Fire

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top