{
  "__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": "a"
            },
            {
              "__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": "a"
            },
            {
              "__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": "q * (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 = (q*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 = (q*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               ``q``\n``linear`` (default)            7               ``1 - q``\n``median_unbiased``             8               ``q/3 + 1/3``\n``normal_unbiased``             9               ``q/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. 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 H&F that are continuous functions of probability "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (estimators 4-9). NumPy also provides the three discontinuous estimators from H&F (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 a function of the real-valued "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "index = q*n + m - 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__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": "For backward compatibility with previous versions of NumPy, "
            },
            {
              "__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 four additional discontinuous estimators. Like "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method='linear'"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", all have "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "m = 1 - q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " so that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j = q*(n-1) // 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "g"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is defined as follows."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "lower"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = 0"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "midpoint"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = 0.5"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "higher"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = 1"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "nearest"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "g = (q*(n-1) % 1) > 0.5"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Weighted quantiles:"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " More formally, the quantile at probability level "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of a cumulative distribution function "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "F(y)=P(Y \\leq y)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with probability measure "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "P"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is defined as any number "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that fulfills the "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "coverage conditions"
                }
              ]
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "P(Y < x) \\leq q \\quad\\text{and}\\quad P(Y \\leq x) \\geq q"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "with random variable "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "Y\\sim P"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Sample quantiles, the result of "
            },
            {
              "__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": ", provide nonparametric estimation of the underlying population counterparts, represented by the unknown "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "F"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", given a data vector "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of length "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Some of the estimators above arise when one considers "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "F"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " as the empirical distribution function of the data, i.e. "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "F(y) = \\frac{1}{n} \\sum_i 1_{a_i \\leq y}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Then, different methods correspond to different choices of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that fulfill the above coverage conditions. Methods that follow this approach are "
            },
            {
              "__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": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For weighted quantiles, the coverage conditions still hold. The empirical cumulative distribution is simply replaced by its weighted version, i.e. "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "P(Y \\leq t) = \\frac{1}{\\sum_i w_i} \\sum_i w_i 1_{x_i \\leq t}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Only "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method=\"inverted_cdf\""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " supports weights."
            }
          ]
        }
      ],
      "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": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "q"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a single probability and "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "axis=None",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", then the result is a scalar. If multiple probability levels are given, first axis of the result corresponds to the quantiles. The other axes are the axes that remain after the reduction of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If the input contains integers or floats smaller than "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "float64"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", the output data-type is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "float64"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Otherwise, the output data-type is the same as that of the input. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "out"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is specified, that array is returned instead."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Compute the q-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": "a",
              "annotation": "array_like of real numbers",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Input array or object that can be converted to an array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "q",
              "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."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "axis",
              "annotation": "{int, tuple of int, None}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Axis or axes along which the quantiles are computed. The default is to compute the quantile(s) along a flattened version of the array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out",
              "annotation": "ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output, but the type (of the output) will be cast if necessary."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "overwrite_input",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, then allow the input array "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to be modified by intermediate calculations, to save memory. In this case, the contents of the input "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " after this function completes is undefined."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "method",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "This parameter specifies the method to use for estimating the quantile.  There are many different methods, some unique to NumPy. The recommended 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": "The first three methods are discontinuous. For backward compatibility with previous versions of NumPy, the following discontinuous variations of the default 'linear' (7.) option are available:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'lower'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'higher',"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'midpoint'"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'nearest'"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "See Notes for details."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionchanged",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionchanged 1.22.0"
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "This argument was previously called \"interpolation\" and only offered the \"linear\" default and last four options."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "keepdims",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original array "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "weights",
              "annotation": "array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An array of weights associated with the values in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Each value in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " contributes to the quantile according to its associated weight. The weights array can either be 1-D (in which case its length must be the size of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " along the given axis) or of the same shape as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "weights=None",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", then all data in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are assumed to have a weight equal to one. Only "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "method=\"inverted_cdf\"",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " supports weights. See the notes for more details."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 2.0.0"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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": "/numpy/lib/_function_base_impl.py",
  "item_line": 4255,
  "item_type": "_ArrayFunctionDispatcher",
  "aliases": [
    "numpy.quantile"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\na = np.array([[10, 7, 4], [3, 2, 1]])\na\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.quantile(a, 0.5)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.quantile(a, 0.5, axis=0)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.quantile(a, 0.5, axis=1)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.quantile(a, 0.5, axis=1, keepdims=True)\nm = np.quantile(a, 0.5, axis=0)\nout = np.zeros_like(m)\nnp.quantile(a, 0.5, axis=0, out=out)\nm\nb = a.copy()\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.quantile(b, 0.5, axis=1, overwrite_input=True)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "assert not np.all(a == b)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nSee also `numpy.percentile` for a visualization of most methods."
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "mean",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "mean"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "median",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "median"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "quantile(..., 0.5)"
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "nanquantile",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "nanquantile"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "percentile",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "percentile"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "equivalent to quantile, but with q in the range [0, 100]."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "q",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "axis",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "out",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "overwrite_input",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "False"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "method",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "linear"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "keepdims",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "False"
      },
      {
        "__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"
  ],
  "qa": "numpy:quantile",
  "arbitrary": [],
  "local_refs": [
    "a",
    "axis",
    "keepdims",
    "method",
    "out",
    "overwrite_input",
    "q",
    "quantile",
    "weights"
  ]
}