{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "You can do all this with "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "slice",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "numpy.strings:slice"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " plus a few special objects, but there's a lot to remember and this version is simpler because it uses the standard array indexing syntax."
            }
          ]
        }
      ],
      "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": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A nicer way to build up index tuples for arrays."
            }
          ]
        }
      ],
      "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": "maketuple",
              "annotation": "bool",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, always returns a tuple."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "note",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "note "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Use one of the two predefined instances "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "index_exp"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " or "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "s_",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " rather than directly using "
                },
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "IndexExpression",
                  "reference": {
                    "__type": "LocalRef",
                    "__tag": 4022,
                    "kind": "module",
                    "path": "numpy.lib._index_tricks_impl:IndexExpression"
                  },
                  "kind": "module"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "."
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For any index combination, including slicing and axis insertion, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a[indices]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the same as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a[np.index_exp[indices]]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for any array "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "a",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". However, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "np.index_exp[indices]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can be used anywhere in Python code and returns a tuple of slice objects that can be used in the construction of complex index expressions."
            }
          ]
        }
      ],
      "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/numpy/lib/_index_tricks_impl.py",
  "item_line": 723,
  "item_type": "class",
  "aliases": [
    "numpy.lib._index_tricks_impl.IndexExpression"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nnp.s_[2::2]\nnp.index_exp[2::2]\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.array([0, 1, 2, 3, 4])[np.s_[2::2]]\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "s_",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "s_"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Predefined instance without tuple conversion: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "s_ = IndexExpression(maketuple=False)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "index_exp"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is another predefined instance that always returns a tuple: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "index_exp = IndexExpression(maketuple=True)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "maketuple",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "IndexExpression"
  },
  "references": null,
  "qa": "numpy.lib._index_tricks_impl:IndexExpression",
  "arbitrary": [],
  "local_refs": [
    "maketuple"
  ]
}