{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Given a sample "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " from an underlying distribution, "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "quantile",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": null,
                "version": null,
                "kind": "local",
                "path": "quantile"
              },
              "kind": "local"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " provides a nonparametric estimate of the inverse cumulative distribution function."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "By default, this is done by interpolating between adjacent elements in "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "y"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", a sorted copy of "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ":      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "(1-g)*y[j] + g*y[j+1]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where the index "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and coefficient "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "g"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are the integral and fractional components of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p * (n-1)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the number of elements in the sample."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This is a special case of Equation 1 of H&F "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". More generally,"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "j = (p*n + m - 1) // 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = (p*n + m - 1) % 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ","
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "m"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " may be defined according to several different conventions. The preferred convention may be selected using the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameter:"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "=============================== =============== ===============\n``method``                      number in H&F   ``m``\n=============================== =============== ===============\n``interpolated_inverted_cdf``   4               ``0``\n``hazen``                       5               ``1/2``\n``weibull``                     6               ``p``\n``linear`` (default)            7               ``1 - p``\n``median_unbiased``             8               ``p/3 + 1/3``\n``normal_unbiased``             9               ``p/4 + 3/8``\n=============================== =============== ===============",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that indices "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j + 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are clipped to the range "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n - 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " when the results of the formula would be outside the allowed range of non-negative indices. When "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is clipped to zero, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "g"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is set to zero as well. The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "-1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in the formulas for "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "g"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " accounts for Python's 0-based indexing."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The table above includes only the estimators from "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that are continuous functions of probability "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "p"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (estimators 4-9). SciPy also provides the three discontinuous estimators from "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (estimators 1-3), where "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is defined as above, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "m"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is defined as follows, and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "g"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " when "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "index = p*n + m - 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is less than "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and otherwise is defined below."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": true,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "inverted_cdf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "m = 0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = int(index - j > 0)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "averaged_inverted_cdf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "m = 0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and    "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = (1 + int(index - j > 0)) / 2"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "closest_observation"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "m = -1/2"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and    "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = 1 - int((index == j) & (j%2 == 1))"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that for methods "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "inverted_cdf"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "averaged_inverted_cdf"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", only the relative proportions of tied observations (and relative weights) affect the results; for all other methods, the total number of observations (and absolute weights) matter."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A different strategy for computing quantiles from "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method='harrell-davis'"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", uses a weighted combination of all elements. The weights are computed as:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "w_{n, i} = I_{i/n}(a, b) - I_{(i - 1)/n}(a, b)"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the number of elements in the sample, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "i"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are the indices "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "1, 2, ..., n-1, n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the sorted elements, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "a = p (n + 1)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "b = (1 - p)(n + 1)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "p"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the probability of the quantile, and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "I"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the regularized, lower incomplete beta function ("
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.special.betainc",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ")."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method='round_nearest'"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is equivalent to indexing "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "y[j]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", where      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "j = int(np.round(p*n) if p < 0.5 else np.round(n*p - 1))",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This is useful when winsorizing data: replacing "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p*n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the most extreme observations with the next most extreme observation. "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method='round_outward'"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " adjusts the direction of rounding to winsorize fewer elements      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "j = int(np.floor(p*n) if p < 0.5 else np.ceil(n*p - 1))",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method='round_inward'"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " rounds to winsorize more elements      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "j = int(np.ceil(p*n) if p < 0.5 else np.floor(n*p - 1))",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "These methods are also useful for trimming data: removing "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p*n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the most extreme observations. See "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "outliers",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for example applications."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Array API Standard Support"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "quantile",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": null,
                "version": null,
                "kind": "local",
                "path": "quantile"
              },
              "kind": "local"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "SCIPY_ARRAY_API=1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "====================  ====================  ====================\nLibrary               CPU                   GPU\n====================  ====================  ====================\nNumPy                 ✅                     n/a                 \nCuPy                  n/a                   ✅                   \nPyTorch               ✅                     ✅                   \nJAX                   ⚠️ no JIT             ⚠️ no JIT           \nDask                  ⛔                     n/a                 \n====================  ====================  ====================",
          "execution_status": null
        },
        {
          "__type": "Blockquote",
          "__tag": 4059,
          "children": [
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "See "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "dev-arrayapi",
                  "domain": null,
                  "role": "ref",
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " for more information."
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "quantile",
              "annotation": "scalar or ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The resulting quantile(s). The dtype is the result dtype of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Compute the p-th quantile of the data along the specified axis."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "x",
              "annotation": "array_like of real numbers",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Data array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "p",
              "annotation": "array_like of float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Probability or sequence of probabilities of the quantiles to compute. Values must be between 0 and 1 (inclusive). While "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.quantile",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy:quantile"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " can only compute quantiles according to the Cartesian product of the first two arguments, this function enables calculation of quantiles at different probabilities for each axis slice by following broadcasting rules like those of "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "scipy.stats",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.stats"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " reducing functions. See "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "keepdims"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and the examples."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "method",
              "annotation": "str, default: 'linear'",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The method to use for estimating the quantile. The available options, numbered as they appear in "
                    },
                    {
                      "__type": "FootnoteReference",
                      "__tag": 4066,
                      "label": "1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", are:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": true,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'inverted_cdf'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'averaged_inverted_cdf'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'closest_observation'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'interpolated_inverted_cdf'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'hazen'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'weibull'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'linear'  (default)"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'median_unbiased'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'normal_unbiased'"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "'harrell-davis' is also available to compute the quantile estimate according to "
                    },
                    {
                      "__type": "FootnoteReference",
                      "__tag": 4066,
                      "label": "2"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "'round_outward', 'round_inward', and 'round_nearest' are available for use in trimming and winsorizing data."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "See Notes for details."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "axis",
              "annotation": "int or None, default: 0",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Axis along which the quantiles are computed. "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "None"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " ravels both "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " before performing the calculation, without checking whether the original shapes were compatible. As in other "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "scipy.stats",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.stats"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " functions, a positive integer "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is resolved after prepending 1s to the shape of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " as needed until the two arrays have the same dimensionality. When providing "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " with different dimensionality, consider using negative "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " integers for clarity."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "nan_policy",
              "annotation": "str, default: 'propagate'",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Defines how to handle NaNs in the input data "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "propagate"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ": if a NaN is present in the axis slice (e.g. row) along   which the  statistic is computed, the corresponding slice of the output   will contain NaN(s)."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "omit"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ": NaNs will be omitted when performing the calculation.   If insufficient data remains in the axis slice along which the   statistic is computed, the corresponding slice of the output will   contain NaN(s)."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "raise"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ": if a NaN is present, a "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "ValueError"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " will be raised."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If NaNs are present in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", a "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "ValueError"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will be raised."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "keepdims",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Consider the case in which "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is 1-D and "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a scalar: the quantile is a reducing statistic, and the default behavior is to return a scalar. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "keepdims"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is set to True, the axis will not be reduced away, and the result will be a 1-D array with one element."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The general case is more subtle, since multiple quantiles may be requested for each axis-slice of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". For instance, if both "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are 1-D and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "p.size > 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", no axis can be reduced away; there must be an axis to contain the number of quantiles given by "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "p.size"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Therefore:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "By default, the axis will be reduced away if possible (i.e. if there is   exactly one element of "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "p"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " per axis-slice of "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "x"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ")."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "If "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "keepdims"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is set to True, the axis will not be reduced away."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "If "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "keepdims"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is set to False, the axis will be reduced away   if possible, and an error will be raised otherwise."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "weights",
              "annotation": "array_like of finite, non-negative real numbers",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Frequency weights; e.g., for counting number weights, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "quantile(x, p, weights=weights)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is equivalent to "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "quantile(np.repeat(x, weights), p)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Values other than finite counting numbers are accepted, but may not have valid statistical interpretations. Not compatible with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "method='harrell-davis'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or those that begin with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'round_'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/stats/_quantile.py",
  "item_line": 138,
  "item_type": "function",
  "aliases": [
    "scipy.stats.quantile"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy import stats\nx = np.asarray([[10, 8, 7, 5, 4],\n                [0, 1, 2, 3, 5]])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTake the median of each row.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "stats.quantile(x, 0.5, axis=-1)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTake a different quantile for each row.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "stats.quantile(x, [[0.25], [0.75]], axis=-1, keepdims=True)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTake multiple quantiles for each row.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "stats.quantile(x, [0.25, 0.75], axis=-1)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTake different quantiles for each row.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "p = np.asarray([[0.25, 0.75],\n                [0.5, 1.0]])\nstats.quantile(x, p, axis=-1)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTake different quantiles for each column.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "stats.quantile(x.T, p.T, axis=0)\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "numpy.quantile",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "numpy.quantile"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "outliers",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "outliers"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "ref"
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "x",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "p",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "method",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "linear"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "axis",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "0"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "nan_policy",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "propagate"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "keepdims",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "weights",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "quantile"
  },
  "references": [
    ".. [1] R. J. Hyndman and Y. Fan,",
    "   \"Sample quantiles in statistical packages,\"",
    "   The American Statistician, 50(4), pp. 361-365, 1996",
    ".. [2] Harrell, Frank E., and C. E. Davis.",
    "   \"A new distribution-free quantile estimator.\"",
    "   Biometrika 69.3 (1982): 635-640."
  ],
  "qa": "scipy.stats._quantile:quantile",
  "arbitrary": [],
  "local_refs": [
    "axis",
    "keepdims",
    "method",
    "nan_policy",
    "p",
    "quantile",
    "weights",
    "x"
  ]
}