{
  "__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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "TypeError if the instance was created as a single rotation.",
              "desc": []
            }
          ]
        }
      ],
      "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": "rotation",
              "annotation": "`Rotation` instance",
              "desc": [
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "Contains"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "BulletList",
                          "__tag": 4053,
                          "ordered": false,
                          "start": 1,
                          "children": [
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "a single rotation, if "
                                    },
                                    {
                                      "__type": "ParamRef",
                                      "__tag": 4071,
                                      "name": "indexer"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": " is a single index"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "a stack of rotation(s), if "
                                    },
                                    {
                                      "__type": "ParamRef",
                                      "__tag": 4071,
                                      "name": "indexer"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": " is a slice, or and index       array."
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Extract rotation(s) at given index(es) from object."
            }
          ]
        }
      ],
      "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": "indexer",
              "annotation": "index, slice, or index array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Specifies which rotation(s) to extract. A single indexer must be specified, i.e. as if indexing a 1 dimensional array or list."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Create a new "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "Rotation",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.spatial.transform._rotation:Rotation"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " instance containing a subset of rotations stored in this object."
            }
          ]
        }
      ],
      "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/spatial/transform/_rotation.py",
  "item_line": 2150,
  "item_type": "function",
  "aliases": [
    "scipy.spatial.transform.Rotation.__getitem__"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.spatial.transform import Rotation as R\nrs = R.from_quat([\n[1, 1, 0, 0],\n[0, 1, 0, 1],\n[1, 1, -1, 0]])  # These quats are normalized\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "rs.as_quat()\n",
        "execution_status": "failure",
        "out": "array([[ 0.70711,  0.70711,  0.     ,  0.     ],\n       [ 0.     ,  0.70711,  0.     ,  0.70711],\n       [ 0.57735,  0.57735, -0.57735,  0.     ]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIndexing using a single index:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "a = rs[0]\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "a.as_quat()\n",
        "execution_status": "failure",
        "out": "array([0.70711, 0.70711, 0.     , 0.     ])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nArray slicing:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "b = rs[1:3]\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "b.as_quat()\n",
        "execution_status": "failure",
        "out": "array([[ 0.     ,  0.70711,  0.     ,  0.70711],\n       [ 0.57735,  0.57735, -0.57735,  0.     ]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nList comprehension to split each rotation into its own object:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "c = [r for r in rs]\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "print([r.as_quat() for r in c])\n",
        "execution_status": "failure",
        "out": "[array([0.70711, 0.70711, 0.     , 0.     ]), array([0.     , 0.70711, 0.     , 0.70711]), array([ 0.57735,  0.57735, -0.57735,  0.     ])]\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nConcatenation of split rotations will recover the original object:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "R.concatenate([a, b]).as_quat()\n",
        "execution_status": "failure",
        "out": "array([[ 0.70711,  0.70711,  0.     ,  0.     ],\n       [ 0.     ,  0.70711,  0.     ,  0.70711],\n       [ 0.57735,  0.57735, -0.57735,  0.     ]])\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "self",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "indexer",
        "annotation": "int | slice | EllipsisType | Array | None",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "Rotation",
    "target_name": "__getitem__"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rotation:Rotation.__getitem__",
  "arbitrary": [],
  "local_refs": [
    "indexer",
    "rotation"
  ]
}