{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": "minimums, maximums",
              "annotation": "int or ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Values of minimums and maximums in each feature."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "min_positions, max_positions",
              "annotation": "tuple or list of tuples",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Each tuple gives the N-D coordinates of the corresponding minimum or maximum."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Calculate the minimums and maximums of the values of an array at labels, along with their positions."
            }
          ]
        }
      ],
      "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": "input",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "N-D image data to process."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "labels",
              "annotation": "ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Labels of features in input. If not None, must be same shape as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "input"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "index",
              "annotation": "int or sequence of ints, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Labels to include in output.  If None (default), all values where non-zero "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "labels"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are used."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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": "build-install/usr/lib/python3.14/site-packages/scipy/ndimage/_measurements.py",
  "item_line": 1406,
  "item_type": "function",
  "aliases": [
    "scipy.ndimage.extrema"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\na = np.array([[1, 2, 0, 0],\n              [5, 3, 0, 4],\n              [0, 0, 0, 7],\n              [9, 3, 0, 0]])\nfrom scipy import ndimage\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ndimage.extrema(a)\n",
        "execution_status": "failure",
        "out": "(np.int64(0), np.int64(9), (np.int64(0), np.int64(2)), (np.int64(3), np.int64(0)))\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFeatures to process can be specified using `labels` and `index`:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "lbl, nlbl = ndimage.label(a)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ndimage.extrema(a, lbl, index=np.arange(1, nlbl+1))\n",
        "execution_status": "failure",
        "out": "(array([1, 4, 3]), array([5, 7, 9]), [(np.int64(0), np.int64(0)), (np.int64(1), np.int64(3)), (np.int64(3), np.int64(1))], [(np.int64(1), np.int64(0)), (np.int64(2), np.int64(3)), (np.int64(3), np.int64(0))])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIf no index is given, non-zero `labels` are processed:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ndimage.extrema(a, lbl)\n",
        "execution_status": "failure",
        "out": "(np.int64(1), np.int64(9), (np.int64(0), np.int64(0)), (np.int64(3), np.int64(0)))\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "center_of_mass",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.ndimage._measurements:center_of_mass"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "maximum",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.ndimage._measurements:maximum"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "maximum_position",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.ndimage._measurements:maximum_position"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "minimum",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.ndimage._measurements:minimum"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "minimum_position",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.ndimage._measurements:minimum_position"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "input",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "labels",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "index",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "extrema"
  },
  "references": null,
  "qa": "scipy.ndimage._measurements:extrema",
  "arbitrary": [],
  "local_refs": [
    "index",
    "input",
    "labels",
    "max_positions",
    "maximums",
    "min_positions",
    "minimums"
  ]
}