summaryrefslogtreecommitdiff
path: root/redis/commands/bf/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/commands/bf/commands.py')
-rw-r--r--redis/commands/bf/commands.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/redis/commands/bf/commands.py b/redis/commands/bf/commands.py
index 84a6b5f..0fe065d 100644
--- a/redis/commands/bf/commands.py
+++ b/redis/commands/bf/commands.py
@@ -49,6 +49,7 @@ TDIGEST_QUANTILE = "TDIGEST.QUANTILE"
TDIGEST_MIN = "TDIGEST.MIN"
TDIGEST_MAX = "TDIGEST.MAX"
TDIGEST_INFO = "TDIGEST.INFO"
+TDIGEST_TRIMMED_MEAN = "TDIGEST.TRIMMED_MEAN"
TDIGEST_MERGESTORE = "TDIGEST.MERGESTORE"
@@ -418,6 +419,16 @@ class TDigestCommands:
""" # noqa
return self.execute_command(TDIGEST_INFO, key)
+ def trimmed_mean(self, key, low_cut_quantile, high_cut_quantile):
+ """
+ Return mean value from the sketch, excluding observation values outside
+ the low and high cutoff quantiles.
+ For more information see `TDIGEST.TRIMMED_MEAN <https://redis.io/commands/tdigest.trimmed_mean>`_.
+ """ # noqa
+ return self.execute_command(
+ TDIGEST_TRIMMED_MEAN, key, low_cut_quantile, high_cut_quantile
+ )
+
def mergestore(self, dest_key, numkeys, *sourcekeys, compression=False):
"""
Merges all of the values from `sourcekeys` keys to `dest_key` sketch.