tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRanktuple_select_rank (Operator)
Name
tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRanktuple_select_rank
— Select the element of rank n of a tuple.
Signature
def tuple_select_rank(tuple: MaybeSequence[Union[float, int]], rank_index: Union[float, int]) -> Union[float, int]
Description
tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRanktuple_select_rank
sorts the elements of the tuple
TupleTupleTupletupletuple
and returns the element of rank n in SelectedSelectedSelectedselectedselected
.
RankIndexRankIndexRankIndexrankIndexrank_index
determines the index of the element to select.
Thus, RankIndexRankIndexRankIndexrankIndexrank_index
may only contain integer values (any floating point
number in RankIndexRankIndexRankIndexrankIndexrank_index
must represent an integer value without
fraction). Indices of tuple elements start at 0, i.e. the lowest
tuple element has the index 0.
Exception: Empty input tuples
If RankIndexRankIndexRankIndexrankIndexrank_index
is empty, the operator returns an empty tuple.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRanktuple_select_rank
,
which can be used in an expression in the following syntax:
Selected := select_rank(Tuple, RankIndex)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
TupleTupleTupletupletuple
(input_control) number(-array) →
HTupleMaybeSequence[Union[float, int]]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Input tuple.
RankIndexRankIndexRankIndexrankIndexrank_index
(input_control) number →
HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Rank of the element to select.
SelectedSelectedSelectedselectedselected
(output_control) number →
HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Selected tuple element.
Alternatives
tuple_sort_indextuple_sort_indexTupleSortIndexTupleSortIndextuple_sort_index
,
tuple_sorttuple_sortTupleSortTupleSorttuple_sort
See also
tuple_mediantuple_medianTupleMedianTupleMediantuple_median
,
tuple_selecttuple_selectTupleSelectTupleSelecttuple_select
Module
Foundation