mrank#

swordfish.function.mrank()#

Return the rank of each element of X in a sliding window.

参数:
  • X (Constant) -- A vector/matrix/table/tuple (with scalars or equal-length vectors)/dictionary.

  • ascending (Constant) -- A Boolean value indicating whether the sorting direction is ascending.

  • window (Constant) -- An integer no smaller than 2 or a scalar of DURATION type indicating the size of the sliding window. Note: The window size is capped at 102400 when m-functions are used in the streaming engines.

  • ignoreNA (Constant) -- A Boolean value indicating whether null values are ignored in ranking. The default value is true. If null values participate in the ranking, they are ranked the lowest.

  • tiesMethod (Constant) --

    A string indicating how to rank the group of records with the same value (i.e., ties):

    • 'min': lowest rank of the group

    • 'max': highest rank of the group

    • 'average': average rank of the group

  • percent (Constant) -- A Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.

  • minPeriods (Constant, optional) -- A positive integer indicating the minimum number of observations in a window required to be not null (otherwise the result is NULL).