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?
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?