{
  "schema_version": 2,
  "id": "commands/tdigest.trimmed_mean",
  "title": "TDIGEST.TRIMMED_MEAN",
  "url": "https://redis.io/docs/latest/commands/tdigest.trimmed_mean/",
  "summary": "Returns an estimation of the mean value from the sketch, excluding observation values outside the low and high cutoff quantiles",
  "since": "2.4.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:54+01:00",
  "page_type": "content",
  "content_hash": "aa3fdb136b933dc3d2f2a2d1714a62de97acc8f80ec8b7232806220edabc4d06",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns an estimation of the mean value from the sketch, excluding observation values outside the low and high cutoff quantiles."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary> \n\nis the key name for an existing t-digest sketch.\n</details>\n\n<details open><summary><code>low_cut_quantile</code></summary> \n  \na floating-point value in the range [0..1]. It must be lower than `high_cut_quantile`.\n  \nWhen equal to 0, no low cut.\n  \nWhen greater than 0, exclude observation values lower than this quantile.\n</details>\n\n<details open><summary><code>high_cut_quantile</code></summary> \n  \na floating-point value in the range [0..1]. It must be higher than `low_cut_quantile`.\n  \nWhen less than 1, exclude observation values greater than or equal to this quantile.\n\nWhen equal to 1, no high cut.\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> TDIGEST.CREATE t COMPRESSION 1000\nOK\nredis> TDIGEST.ADD t 1 2 3 4 5 6 7 8 9 10\nOK\nredis> TDIGEST.TRIMMED_MEAN t 0.1 0.6\n\"4\"\nredis> TDIGEST.TRIMMED_MEAN t 0.3 0.9\n\"6.5\"\nredis> TDIGEST.TRIMMED_MEAN t 0 1\n\"5.5\""
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n\n* [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) as a floating-point estimation of the mean value.\n* `nan` if the sketch is empty.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: the given key does not exist or is of an incorrect type, quantiles out of range [0..1], or incorrect number of arguments.\n\n**RESP3:**\n\nOne of the following:\n\n* [Double reply](https://redis.io/docs/latest/develop/reference/protocol-spec#doubles) as an estimation of the mean value.\n* `nan` if the sketch is empty.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: the given key does not exist or is of an incorrect type, quantiles out of range [0..1], or incorrect number of arguments."
    }
  ],
  "examples": []
}
