Skip to content

tuple_histo_rangeTupleHistoRangeTupleHistoRangetuple_histo_rangeT_tuple_histo_range🔗

Short description🔗

tuple_histo_rangeTupleHistoRangeTupleHistoRangetuple_histo_rangeT_tuple_histo_range — Calculate the value distribution of a tuple within a certain value range.

Signature🔗

tuple_histo_range( number Tuple, number Min, number Max, integer NumBins, out histogram Histo, out real BinSize )void TupleHistoRange( const HTuple& Tuple, const HTuple& Min, const HTuple& Max, const HTuple& NumBins, HTuple* Histo, HTuple* BinSize )static void HOperatorSet.TupleHistoRange( HTuple tuple, HTuple min, HTuple max, HTuple numBins, out HTuple histo, out HTuple binSize )def tuple_histo_range( tuple: Sequence[Union[float, int]], min: Union[float, int], max: Union[float, int], num_bins: int ) -> Tuple[Sequence[int], float]

def tuple_histo_range_s( tuple: Sequence[Union[float, int]], min: Union[float, int], max: Union[float, int], num_bins: int ) -> Tuple[int, float]Herror T_tuple_histo_range( const Htuple Tuple, const Htuple Min, const Htuple Max, const Htuple NumBins, Htuple* Histo, Htuple* BinSize )

HTuple HTuple::TupleHistoRange( const HTuple& Min, const HTuple& Max, const HTuple& NumBins, HTuple* BinSize ) const

HTuple HTuple.TupleHistoRange( HTuple min, HTuple max, HTuple numBins, out HTuple binSize )

Description🔗

tuple_histo_rangeTupleHistoRange calculates the value distribution Histohistohisto of the Tupletupletuple within the value range \([\textrm{Min},\textrm{Max}]\). The values for Minminmin and Maxmaxmax are rounded down to the next integer if all entries of the Tupletupletuple are of type integer. The value range is divided into NumBinsnumBinsnum_bins bins of the same size, which is returned in BinSizebinSizebin_size. If a value lies between two bins the value is assigned to the smaller bin. If the Tupletupletuple has entries of type real \(\textrm{BinSize} = \frac{\textrm{Max} - \textrm{Min}}{\textrm{NumBins}}\). If all entries are of type integer the size of a bin is computed with \(\textrm{BinSize} = \frac{\textrm{Max} - \textrm{Min} + 1} {\textrm{NumBins}}\).

Exception: Empty input tuples🔗

If any of the input tuples is empty, an exception is raised.

Attention🔗

If all the data of the Tupletupletuple are of type integer the value of BinSizebinSizebin_size may cause the following effects: For BinSizebinSizebin_size \(>\) 11 multiple consecutive numbers are assigned to the same bin. If BinSizebinSizebin_size is no integer the numbers are distributed uneven among the bins, e.g., for BinSizebinSizebin_size \(=\) 1.51.5 the first and second number are assigned to the first bin, the third number is assigned to the second bin, and the fourth and fifth number are assigned to the third bin. This becomes noticeable in several peeks in the histogram Histohistohisto. If BinSizebinSizebin_size \(<\) 11 some classes are not assigned by any number, e.g., for BinSizebinSizebin_size \(=\) 0.50.5 the first number is assigned to the first bin and the second number is assigned to the third bin. The histogram Histohistohisto shows some gaps, which resembles the structure of a comb.

If the Tupletupletuple has entries of type real and \(\textrm{Min} = \textrm{Max}\), all entries of the corresponding value are assigned only to the first bin.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

Parameters🔗

Tupletupletuple (input_control) number-array → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Input tuple.

Minminmin (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Minimum value.

Maxmaxmax (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Maximum value.

Restriction: Max >= Min

NumBinsnumBinsnum_bins (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of bins.

Restriction: NumBins >= 1

Histohistohisto (output_control) histogram(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Histogram to be calculated.

BinSizebinSizebin_size (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Bin size.

Result🔗

If the parameters are valid, the operator tuple_histo_rangeTupleHistoRange returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

tuple_minTupleMin, tuple_maxTupleMax

Possible successors

create_funct_1d_arrayCreateFunct1dArray

See also

gray_histoGrayHisto, gray_histo_absGrayHistoAbs, gray_histo_rangeGrayHistoRange

Module🔗

Foundation