{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "user:quickstart",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "NumPy quickstart"
        }
      ],
      "level": 0,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "You'll need to know a bit of Python. For a refresher, see the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Python tutorial"
                }
              ],
              "url": "https://docs.python.org/tutorial/",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To work the examples, you'll need "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "matplotlib"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " installed in addition to NumPy."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Learner profile"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This is a quick overview of arrays in NumPy. It demonstrates how n-dimensional ("
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n>=2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ") arrays are represented and can be manipulated. In particular, if you don't know how to apply common functions to n-dimensional arrays (without using for-loops), or if you want to understand axis and shape properties for n-dimensional arrays, this article might be of help."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Learning Objectives"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "After reading, you should be able to:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Understand the difference between one-, two- and n-dimensional arrays in   NumPy;"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Understand how to apply some linear algebra operations to n-dimensional   arrays without using for-loops;"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Understand axis and shape properties for n-dimensional arrays."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Prerequisites"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "NumPy's main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a tuple of non-negative integers. In NumPy dimensions are called "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "axes"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For example, the array for the coordinates of a point in 3D space, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "[1, 2, 1]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", has one axis. That axis has 3 elements in it, so we say it has a length of 3. In the example pictured below, the array has 2  axes. The first axis has a length of 2, the second axis has a length of  3."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "[[1., 0., 0.],\n [0., 1., 2.]]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "NumPy's array class is called "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ndarray"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". It is also known by the alias "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Note that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "numpy.array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is not the same as the Standard Python Library class "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array.array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", which only handles one-dimensional arrays and offers less functionality. The more important attributes of an "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ndarray"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " object are:"
            }
          ]
        },
        {
          "__type": "DefList",
          "__tag": 4033,
          "children": [
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "ndarray.ndim"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the number of axes (dimensions) of the array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "ndarray.shape"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the dimensions of the array. This is a tuple of integers indicating     the size of the array in each dimension. For a matrix with "
                    },
                    {
                      "__type": "Emphasis",
                      "__tag": 4047,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "n"
                        }
                      ]
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " rows     and "
                    },
                    {
                      "__type": "Emphasis",
                      "__tag": 4047,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "m"
                        }
                      ]
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " columns, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "shape"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will be "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(n,m)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". The length of the     "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "shape"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " tuple is therefore the number of axes, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "ndim"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "ndarray.size"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the total number of elements of the array. This is equal to the     product of the elements of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "shape"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "ndarray.dtype"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "an object describing the type of the elements in the array. One can     create or specify dtype's using standard Python types. Additionally     NumPy provides types of its own. numpy.int32, numpy.int16, and     numpy.float64 are some examples."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "ndarray.itemsize"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the size in bytes of each element of the array. For example, an     array of elements of type "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "float64"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " has "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "itemsize"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " 8 (=64/8),     while one of type "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "complex32"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " has "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "itemsize"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " 4 (=32/8). It is     equivalent to "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "ndarray.dtype.itemsize"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "ndarray.data"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the buffer containing the actual elements of the array. Normally, we     won't need to use this attribute because we will access the elements     in an array using indexing facilities."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "The basics"
        }
      ],
      "level": 1,
      "target": "quickstart.the-basics"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Blockquote",
          "__tag": 4059,
          "children": [
            {
              "__type": "Code",
              "__tag": 4050,
              "value": ">>> import numpy as np\n>>> a = np.arange(15).reshape(3, 5)\n>>> a\narray([[ 0,  1,  2,  3,  4],\n       [ 5,  6,  7,  8,  9],\n       [10, 11, 12, 13, 14]])\n>>> a.shape\n(3, 5)\n>>> a.ndim\n2\n>>> a.dtype.name\n'int64'\n>>> a.itemsize\n8\n>>> a.size\n15\n>>> type(a)\n<class 'numpy.ndarray'>\n>>> b = np.array([6, 7, 8])\n>>> b\narray([6, 7, 8])\n>>> type(b)\n<class 'numpy.ndarray'>",
              "execution_status": null
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "An example"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "There are several ways to create arrays."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For example, you can create an array from a regular Python list or tuple using the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function. The type of the resulting array is deduced from the type of the elements in the sequences."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import numpy as np\n>>> a = np.array([2, 3, 4])\n>>> a\narray([2, 3, 4])\n>>> a.dtype\ndtype('int64')\n>>> b = np.array([1.2, 3.5, 5.1])\n>>> b.dtype\ndtype('float64')",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A frequent error consists in calling "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with multiple arguments, rather than providing a single sequence as an argument."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.array(1, 2, 3, 4)    # WRONG\nTraceback (most recent call last):\n  ...\nTypeError: array() takes from 1 to 2 positional arguments but 4 were given\n>>> a = np.array([1, 2, 3, 4])  # RIGHT",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " transforms sequences of sequences into two-dimensional arrays, sequences of sequences of sequences into three-dimensional arrays, and so on."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> b = np.array([(1.5, 2, 3), (4, 5, 6)])\n>>> b\narray([[1.5, 2. , 3. ],\n       [4. , 5. , 6. ]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The type of the array can also be explicitly specified at creation time:"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> c = np.array([[1, 2], [3, 4]], dtype=complex)\n>>> c\narray([[1.+0.j, 2.+0.j],\n       [3.+0.j, 4.+0.j]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Often, the elements of an array are originally unknown, but its size is known. Hence, NumPy offers several functions to create arrays with initial placeholder content. These minimize the necessity of growing arrays, an expensive operation."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The function "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "zeros"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " creates an array full of zeros, the function "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ones"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " creates an array full of ones, and the function "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "empty"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " creates an array whose initial content is random and depends on the state of the memory. By default, the dtype of the created array is "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "float64"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but it can be specified via the key word argument "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "dtype"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> np.zeros((3, 4))\narray([[0., 0., 0., 0.],\n       [0., 0., 0., 0.],\n       [0., 0., 0., 0.]])\n>>> np.ones((2, 3, 4), dtype=np.int16)\narray([[[1, 1, 1, 1],\n        [1, 1, 1, 1],\n        [1, 1, 1, 1]],\n<BLANKLINE>\n       [[1, 1, 1, 1],\n        [1, 1, 1, 1],\n        [1, 1, 1, 1]]], dtype=int16)\n>>> np.empty((2, 3)) #doctest: +SKIP\narray([[3.73603959e-262, 6.02658058e-154, 6.55490914e-260],  # may vary\n       [5.30498948e-313, 3.14673309e-307, 1.00000000e+000]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To create sequences of numbers, NumPy provides the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "arange"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function which is analogous to the Python built-in "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "range"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but returns an array."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> np.arange(10, 30, 5)\narray([10, 15, 20, 25])\n>>> np.arange(0, 2, 0.3)  # it accepts float arguments\narray([0. , 0.3, 0.6, 0.9, 1.2, 1.5, 1.8])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "arange"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is used with floating point arguments, it is generally not possible to predict the number of elements obtained, due to the finite floating point precision. For this reason, it is usually better to use the function "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "linspace"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that receives as an argument the number of elements that we want, instead of the step      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> from numpy import pi\n>>> np.linspace(0, 2, 9)                   # 9 numbers from 0 to 2\narray([0.  , 0.25, 0.5 , 0.75, 1.  , 1.25, 1.5 , 1.75, 2.  ])\n>>> x = np.linspace(0, 2 * pi, 100)        # useful to evaluate function at lots of points\n>>> f = np.sin(x)",
          "execution_status": null
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "seealso",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "seealso "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "array",
                  "reference": {
                    "__type": "RefInfo",
                    "__tag": 4000,
                    "module": "array",
                    "version": "*",
                    "kind": "api",
                    "path": "array"
                  },
                  "kind": "module"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "zeros",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "zeros_like",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "ones",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "ones_like",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "empty",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "empty_like",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "arange",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "linspace",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "random.Generator.random",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "random.Generator.normal",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "fromfunction",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "fromfile",
                  "domain": null,
                  "role": null,
                  "inventory": null
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Array creation"
        }
      ],
      "level": 2,
      "target": "quickstart.array-creation"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When you print an array, NumPy displays it in a similar way to nested lists, but with the following layout:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the last axis is printed from left to right,"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the second-to-last is printed from top to bottom,"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the rest are also printed from top to bottom, with each slice    separated from the next by an empty line."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "One-dimensional arrays are then printed as rows, bidimensionals as matrices and tridimensionals as lists of matrices."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(6)                    # 1d array\n>>> print(a)\n[0 1 2 3 4 5]\n>>> \n>>> b = np.arange(12).reshape(4, 3)     # 2d array\n>>> print(b)\n[[ 0  1  2]\n [ 3  4  5]\n [ 6  7  8]\n [ 9 10 11]]\n>>> \n>>> c = np.arange(24).reshape(2, 3, 4)  # 3d array\n>>> print(c)\n[[[ 0  1  2  3]\n  [ 4  5  6  7]\n  [ 8  9 10 11]]\n<BLANKLINE>\n [[12 13 14 15]\n  [16 17 18 19]\n  [20 21 22 23]]]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "below",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "user:quickstart"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to get more details on "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "reshape"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If an array is too large to be printed, NumPy automatically skips the central part of the array and only prints the corners      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> print(np.arange(10000))\n[   0    1    2 ... 9997 9998 9999]\n>>> \n>>> print(np.arange(10000).reshape(100, 100))\n[[   0    1    2 ...   97   98   99]\n [ 100  101  102 ...  197  198  199]\n [ 200  201  202 ...  297  298  299]\n ...\n [9700 9701 9702 ... 9797 9798 9799]\n [9800 9801 9802 ... 9897 9898 9899]\n [9900 9901 9902 ... 9997 9998 9999]]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To disable this behaviour and force NumPy to print the entire array, you can change the printing options using "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "set_printoptions"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> np.set_printoptions(threshold=sys.maxsize)  # sys module should be imported",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Printing arrays"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Arithmetic operators on arrays apply "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "elementwise"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". A new array is created and filled with the result."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.array([20, 30, 40, 50])\n>>> b = np.arange(4)\n>>> b\narray([0, 1, 2, 3])\n>>> c = a - b\n>>> c\narray([20, 29, 38, 47])\n>>> b**2\narray([0, 1, 4, 9])\n>>> 10 * np.sin(a)\narray([ 9.12945251, -9.88031624,  7.4511316 , -2.62374854])\n>>> a < 35\narray([ True,  True, False, False])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Unlike in many matrix languages, the product operator "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "*"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " operates elementwise in NumPy arrays. The matrix product can be performed using the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "@"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " operator (in python >=3.5) or the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "dot"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function or method      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> A = np.array([[1, 1],\n...               [0, 1]])\n>>> B = np.array([[2, 0],\n...               [3, 4]])\n>>> A * B     # elementwise product\narray([[2, 0],\n       [0, 4]])\n>>> A @ B     # matrix product\narray([[5, 4],\n       [3, 4]])\n>>> A.dot(B)  # another matrix product\narray([[5, 4],\n       [3, 4]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Some operations, such as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "+="
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "*="
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", act in place to modify an existing array rather than create a new one."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> rg = np.random.default_rng(1)  # create instance of default random number generator\n>>> a = np.ones((2, 3), dtype=int)\n>>> b = rg.random((2, 3))\n>>> a *= 3\n>>> a\narray([[3, 3, 3],\n       [3, 3, 3]])\n>>> b += a\n>>> b\narray([[3.51182162, 3.9504637 , 3.14415961],\n       [3.94864945, 3.31183145, 3.42332645]])\n>>> a += b  # b is not automatically converted to integer type\nTraceback (most recent call last):\n    ...\nnumpy._core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When operating with arrays of different types, the type of the resulting array corresponds to the more general or precise one (a behavior known as upcasting)."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.ones(3, dtype=np.int32)\n>>> b = np.linspace(0, pi, 3)\n>>> b.dtype.name\n'float64'\n>>> c = a + b\n>>> c\narray([1.        , 2.57079633, 4.14159265])\n>>> c.dtype.name\n'float64'\n>>> d = np.exp(c * 1j)\n>>> d\narray([ 0.54030231+0.84147098j, -0.84147098+0.54030231j,\n       -0.54030231-0.84147098j])\n>>> d.dtype.name\n'complex128'",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Many unary operations, such as computing the sum of all the elements in the array, are implemented as methods of the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ndarray"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " class."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = rg.random((2, 3))\n>>> a\narray([[0.82770259, 0.40919914, 0.54959369],\n       [0.02755911, 0.75351311, 0.53814331]])\n>>> a.sum()\n3.1057109529998157\n>>> a.min()\n0.027559113243068367\n>>> a.max()\n0.8277025938204418",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "By default, these operations apply to the array as though it were a list of numbers, regardless of its shape. However, by specifying the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "axis"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameter you can apply an operation along the specified axis of an array      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> b = np.arange(12).reshape(3, 4)\n>>> b\narray([[ 0,  1,  2,  3],\n       [ 4,  5,  6,  7],\n       [ 8,  9, 10, 11]])\n>>>\n>>> b.sum(axis=0)     # sum of each column\narray([12, 15, 18, 21])\n>>>\n>>> b.min(axis=1)     # min of each row\narray([0, 4, 8])\n>>>\n>>> b.cumsum(axis=1)  # cumulative sum along each row\narray([[ 0,  1,  3,  6],\n       [ 4,  9, 15, 22],\n       [ 8, 17, 27, 38]])",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Basic operations"
        }
      ],
      "level": 2,
      "target": "quickstart.basic-operations"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "NumPy provides familiar mathematical functions such as sin, cos, and exp. In NumPy, these are called \"universal functions\" ("
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ufunc"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "). Within NumPy, these functions operate elementwise on an array, producing an array as output."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> B = np.arange(3)\n>>> B\narray([0, 1, 2])\n>>> np.exp(B)\narray([1.        , 2.71828183, 7.3890561 ])\n>>> np.sqrt(B)\narray([0.        , 1.        , 1.41421356])\n>>> C = np.array([2., -1., 4.])\n>>> np.add(B, C)\narray([2., 0., 6.])",
          "execution_status": null
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "seealso",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "seealso "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "all",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "any",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "apply_along_axis",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "argmax",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "argmin",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "argsort",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "average",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "bincount",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "ceil",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "clip",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "conj",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "corrcoef",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "cov",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "cross",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "cumprod",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "cumsum",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "diff",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "dot",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "floor",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "inner",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "invert",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "lexsort",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "max",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "maximum",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "mean",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "median",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "min",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "minimum",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "nonzero",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "outer",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "prod",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "re",
                  "reference": {
                    "__type": "RefInfo",
                    "__tag": 4000,
                    "module": "re",
                    "version": "*",
                    "kind": "api",
                    "path": "re"
                  },
                  "kind": "module"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "round",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "sort",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "std",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "sum",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "trace",
                  "reference": {
                    "__type": "RefInfo",
                    "__tag": 4000,
                    "module": "trace",
                    "version": "*",
                    "kind": "api",
                    "path": "trace"
                  },
                  "kind": "module"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "transpose",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "var",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "vdot",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "vectorize",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "where",
                  "domain": null,
                  "role": null,
                  "inventory": null
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Universal functions"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "One-dimensional"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " arrays can be indexed, sliced and iterated over, much like "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "lists"
                }
              ],
              "url": "https://docs.python.org/tutorial/introduction.html#lists",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and other Python sequences."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(10)**3\n>>> a\narray([  0,   1,   8,  27,  64, 125, 216, 343, 512, 729])\n>>> a[2]\n8\n>>> a[2:5]\narray([ 8, 27, 64])\n>>> # equivalent to a[0:6:2] = 1000;\n>>> # from start to position 6, exclusive, set every 2nd element to 1000\n>>> a[:6:2] = 1000\n>>> a\narray([1000,    1, 1000,   27, 1000,  125,  216,  343,  512,  729])\n>>> a[::-1]  # reversed a\narray([ 729,  512,  343,  216,  125, 1000,   27, 1000,    1, 1000])\n>>> for i in a:\n...     print(i**(1 / 3.))\n...\n9.999999999999998  # may vary\n1.0\n9.999999999999998\n3.0\n9.999999999999998\n4.999999999999999\n5.999999999999999\n6.999999999999999\n7.999999999999999\n8.999999999999998",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Multidimensional"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " arrays can have one index per axis. These indices are given in a tuple separated by commas      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> def f(x, y):\n...     return 10 * x + y\n...\n>>> b = np.fromfunction(f, (5, 4), dtype=int)\n>>> b\narray([[ 0,  1,  2,  3],\n       [10, 11, 12, 13],\n       [20, 21, 22, 23],\n       [30, 31, 32, 33],\n       [40, 41, 42, 43]])\n>>> b[2, 3]\n23\n>>> b[0:5, 1]  # each row in the second column of b\narray([ 1, 11, 21, 31, 41])\n>>> b[:, 1]    # equivalent to the previous example\narray([ 1, 11, 21, 31, 41])\n>>> b[1:3, :]  # each column in the second and third row of b\narray([[10, 11, 12, 13],\n       [20, 21, 22, 23]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When fewer indices are provided than the number of axes, the missing indices are considered complete lices\\ "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ":"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> b[-1]   # the last row. Equivalent to b[-1, :]\narray([40, 41, 42, 43])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The expression within brackets in "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b[i]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is treated as an "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "i"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " followed by as many instances of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ":"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " as needed to represent the remaining axes. NumPy also allows you to write this using dots as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b[i, ...]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "dots"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " ("
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "..."
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ") represent as many colons as needed to produce a complete indexing tuple. For example, if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is an array with 5 axes, then"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x[1, 2, ...]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is equivalent to "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x[1, 2, :, :, :]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ","
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x[..., 3]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x[:, :, :, :, 3]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x[4, ..., 5, :]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x[4, :, :, 5, :]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> c = np.array([[[  0,  1,  2],  # a 3D array (two stacked 2D arrays)\n...                [ 10, 12, 13]],\n...               [[100, 101, 102],\n...                [110, 112, 113]]])\n>>> c.shape\n(2, 2, 3)\n>>> c[1, ...]  # same as c[1, :, :] or c[1]\narray([[100, 101, 102],\n       [110, 112, 113]])\n>>> c[..., 2]  # same as c[:, :, 2]\narray([[  2,  13],\n       [102, 113]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Iterating"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " over multidimensional arrays is done with respect to the first axis      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> for row in b:\n...     print(row)\n...\n[0 1 2 3]\n[10 11 12 13]\n[20 21 22 23]\n[30 31 32 33]\n[40 41 42 43]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "However, if one wants to perform an operation on each element in the array, one can use the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "flat"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " attribute which is an "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "iterator"
                }
              ],
              "url": "https://docs.python.org/tutorial/classes.html#iterators",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " over all the elements of the array      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> for element in b.flat:\n...     print(element)\n...\n0\n1\n2\n3\n10\n11\n12\n13\n20\n21\n22\n23\n30\n31\n32\n33\n40\n41\n42\n43",
          "execution_status": null
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "seealso",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "seealso "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "basics.indexing",
                  "reference": {
                    "__type": "LocalRef",
                    "__tag": 4022,
                    "kind": "docs",
                    "path": "user:basics.indexing"
                  },
                  "kind": "exists"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "arrays.indexing",
                  "reference": {
                    "__type": "LocalRef",
                    "__tag": 4022,
                    "kind": "docs",
                    "path": "reference:routines.indexing"
                  },
                  "kind": "exists"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " (reference), "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "newaxis",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "ndenumerate",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "indices",
                  "domain": null,
                  "role": null,
                  "inventory": null
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Indexing, slicing and iterating"
        }
      ],
      "level": 2,
      "target": "quickstart.indexing-slicing-and-iterating"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Shape manipulation"
        }
      ],
      "level": 1,
      "target": "quickstart.shape-manipulation"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "An array has a shape given by the number of elements along each axis      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.floor(10 * rg.random((3, 4)))\n>>> a\narray([[3., 7., 3., 4.],\n       [1., 4., 2., 2.],\n       [7., 2., 4., 9.]])\n>>> a.shape\n(3, 4)",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The shape of an array can be changed with various commands. Note that the following three commands all return a modified array, but do not change the original array      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a.ravel()  # returns the array, flattened\narray([3., 7., 3., 4., 1., 4., 2., 2., 7., 2., 4., 9.])\n>>> a.reshape(6, 2)  # returns the array with a modified shape\narray([[3., 7.],\n       [3., 4.],\n       [1., 4.],\n       [2., 2.],\n       [7., 2.],\n       [4., 9.]])\n>>> a.T  # returns the array, transposed\narray([[3., 1., 7.],\n       [7., 4., 2.],\n       [3., 2., 4.],\n       [4., 2., 9.]])\n>>> a.T.shape\n(4, 3)\n>>> a.shape\n(3, 4)",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The order of the elements in the array resulting from "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ravel"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is normally \"C-style\", that is, the rightmost index \"changes the fastest\", so the element after "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a[0, 0]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a[0, 1]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". If the array is reshaped to some other shape, again the array is treated as \"C-style\". NumPy normally creates arrays stored in this order, so "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ravel"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " will usually not need to copy its argument, but if the array was made by taking slices of another array or created with unusual options, it may need to be copied. The functions "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ravel"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "reshape"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can also be instructed, using an optional argument, to use FORTRAN-style arrays, in which the leftmost index changes the fastest."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "reshape",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function returns its argument with a modified shape, whereas the "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "ndarray.resize",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method modifies the array itself      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a\narray([[3., 7., 3., 4.],\n       [1., 4., 2., 2.],\n       [7., 2., 4., 9.]])\n>>> a.resize((2, 6))\n>>> a\narray([[3., 7., 3., 4., 1., 4.],\n       [2., 2., 7., 2., 4., 9.]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If a dimension is given as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "-1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in a reshaping operation, the other dimensions are automatically calculated      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a.reshape(3, -1)\narray([[3., 7., 3., 4.],\n       [1., 4., 2., 2.],\n       [7., 2., 4., 9.]])",
          "execution_status": null
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "seealso",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "seealso "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "ndarray.shape",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "reshape",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "resize",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "ravel",
                  "domain": null,
                  "role": null,
                  "inventory": null
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Changing the shape of an array"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Several arrays can be stacked together along different axes      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.floor(10 * rg.random((2, 2)))\n>>> a\narray([[9., 7.],\n       [5., 2.]])\n>>> b = np.floor(10 * rg.random((2, 2)))\n>>> b\narray([[1., 9.],\n       [5., 1.]])\n>>> np.vstack((a, b))\narray([[9., 7.],\n       [5., 2.],\n       [1., 9.],\n       [5., 1.]])\n>>> np.hstack((a, b))\narray([[9., 7., 1., 9.],\n       [5., 2., 5., 1.]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The function "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "column_stack",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " stacks 1D arrays as columns into a 2D array. It is equivalent to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "hstack",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " only for 2D arrays      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> from numpy import newaxis\n>>> np.column_stack((a, b))  # with 2D arrays\narray([[9., 7., 1., 9.],\n       [5., 2., 5., 1.]])\n>>> a = np.array([4., 2.])\n>>> b = np.array([3., 8.])\n>>> np.column_stack((a, b))  # returns a 2D array\narray([[4., 3.],\n       [2., 8.]])\n>>> np.hstack((a, b))        # the result is different\narray([4., 2., 3., 8.])\n>>> a[:, newaxis]  # view `a` as a 2D column vector\narray([[4.],\n       [2.]])\n>>> np.column_stack((a[:, newaxis], b[:, newaxis]))\narray([[4., 3.],\n       [2., 8.]])\n>>> np.hstack((a[:, newaxis], b[:, newaxis]))  # the result is the same\narray([[4., 3.],\n       [2., 8.]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In general, for arrays with more than two dimensions, "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "hstack",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " stacks along their second axes, "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vstack",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " stacks along their first axes, and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "concatenate",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " allows for an optional arguments giving the number of the axis along which the concatenation should happen."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Note"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In complex cases, "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "r_",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "c_",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are useful for creating arrays by stacking numbers along one axis. They allow the use of range literals "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ":"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ".          "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> np.r_[1:4, 0, 4]\narray([1, 2, 3, 0, 4])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When used with arrays as arguments, "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "r_",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "c_",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are similar to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vstack",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "hstack",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in their default behavior, but allow for an optional argument giving the number of the axis along which to concatenate."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "seealso",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "seealso "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "hstack",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "vstack",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "column_stack",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "concatenate",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "c_",
                  "domain": null,
                  "role": null,
                  "inventory": null
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ", "
                },
                {
                  "__type": "InlineRole",
                  "__tag": 4003,
                  "value": "r_",
                  "domain": null,
                  "role": null,
                  "inventory": null
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Stacking together different arrays"
        }
      ],
      "level": 2,
      "target": "quickstart.stacking-arrays"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Using "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "hsplit",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", you can split an array along its horizontal axis, either by specifying the number of equally shaped arrays to return, or by specifying the columns after which the division should occur      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.floor(10 * rg.random((2, 12)))\n>>> a\narray([[6., 7., 6., 9., 0., 5., 4., 0., 6., 8., 5., 2.],\n       [8., 5., 5., 7., 1., 8., 6., 7., 1., 8., 1., 0.]])\n>>> # Split `a` into 3\n>>> np.hsplit(a, 3)\n[array([[6., 7., 6., 9.],\n       [8., 5., 5., 7.]]), array([[0., 5., 4., 0.],\n       [1., 8., 6., 7.]]), array([[6., 8., 5., 2.],\n       [1., 8., 1., 0.]])]\n>>> # Split `a` after the third and the fourth column\n>>> np.hsplit(a, (3, 4))\n[array([[6., 7., 6.],\n       [8., 5., 5.]]), array([[9.],\n       [7.]]), array([[0., 5., 4., 0., 6., 8., 5., 2.],\n       [1., 8., 6., 7., 1., 8., 1., 0.]])]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vsplit",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " splits along the vertical axis, and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "array_split",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " allows one to specify along which axis to split."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Splitting one array into several smaller ones"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When operating and manipulating arrays, their data is sometimes copied into a new array and sometimes not. This is often a source of confusion for beginners. There are three cases:"
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Copies and views"
        }
      ],
      "level": 1,
      "target": "quickstart.copies-and-views"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Simple assignments make no copy of objects or their data."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.array([[ 0,  1,  2,  3],\n...               [ 4,  5,  6,  7],\n...               [ 8,  9, 10, 11]])\n>>> b = a            # no new object is created\n>>> b is a           # a and b are two names for the same ndarray object\nTrue",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Python passes mutable objects as references, so function calls make no copy."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> def f(x):\n...     print(id(x))\n...\n>>> id(a)  # id is a unique identifier of an object #doctest: +SKIP\n148293216  # may vary\n>>> f(a)   #doctest: +SKIP\n148293216  # may vary",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "No copy at all"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Different array objects can share the same data. The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "view"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method creates a new array object that looks at the same data."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> c = a.view()\n>>> c is a\nFalse\n>>> c.base is a            # c is a view of the data owned by a\nTrue\n>>> c.flags.owndata\nFalse\n>>>\n>>> c = c.reshape((2, 6))  # a's shape doesn't change, reassigned c is still a view of a\n>>> a.shape\n(3, 4)\n>>> c[0, 4] = 1234         # a's data changes\n>>> a\narray([[   0,    1,    2,    3],\n       [1234,    5,    6,    7],\n       [   8,    9,   10,   11]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Slicing an array returns a view of it      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> s = a[:, 1:3]\n>>> s[:] = 10  # s[:] is a view of s. Note the difference between s = 10 and s[:] = 10\n>>> a\narray([[   0,   10,   10,    3],\n       [1234,   10,   10,    7],\n       [   8,   10,   10,   11]])",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "View or shallow copy"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "copy"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method makes a complete copy of the array and its data."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> d = a.copy()  # a new array object with new data is created\n>>> d is a\nFalse\n>>> d.base is a  # d doesn't share anything with a\nFalse\n>>> d[0, 0] = 9999\n>>> a\narray([[   0,   10,   10,    3],\n       [1234,   10,   10,    7],\n       [   8,   10,   10,   11]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Sometimes "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "copy"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " should be called after slicing if the original array is not required anymore. For example, suppose "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a huge intermediate result and the final result "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " only contains a small fraction of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", a deep copy should be made when constructing "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with slicing      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(int(1e8))\n>>> b = a[:100].copy()\n>>> del a  # the memory of ``a`` can be released.",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b = a[:100]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is used instead, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is referenced by "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and will persist in memory even if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "del a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is executed."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See also "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "basics.copies-and-views",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "user:basics.copies"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Deep copy"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Here is a list of some useful NumPy functions and methods names ordered in categories. See "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "routines",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "reference:routines"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for the full list."
            }
          ]
        },
        {
          "__type": "DefList",
          "__tag": 4033,
          "children": [
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Array Creation"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "arange",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "array",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "array",
                        "version": "*",
                        "kind": "api",
                        "path": "array"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "copy",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "copy",
                        "version": "*",
                        "kind": "api",
                        "path": "copy"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "empty",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "empty_like",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "eye",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "fromfile",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "fromfunction",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "identity",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "linspace",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "logspace",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "mgrid",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ogrid",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ones",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ones_like",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "r_",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "zeros",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "zeros_like",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Conversions"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ndarray.astype",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",    "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "atleast_1d",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",    "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "atleast_2d",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",    "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "atleast_3d",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",    "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "mat",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Manipulations"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "array_split",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "column_stack",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "concatenate",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "diagonal",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "dsplit",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "dstack",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "hsplit",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "hstack",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ndarray.item",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "newaxis",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ravel",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "repeat",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "reshape",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "resize",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "squeeze",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "swapaxes",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "take",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "transpose",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "vsplit",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "vstack",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Questions"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "all",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "any",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "nonzero",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "where",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Ordering"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "argmax",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "argmin",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "argsort",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "max",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "min",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ptp",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "searchsorted",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "sort",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Operations"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "choose",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "compress",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "cumprod",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "cumsum",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "inner",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "ndarray.fill",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "imag",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "prod",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "put",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "putmask",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "real",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "sum",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Basic Statistics"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "cov",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "mean",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "std",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "var",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Basic Linear Algebra"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "cross",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "dot",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "outer",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "linalg.svd",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",     "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "vdot",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Functions and methods overview"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Less basic"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Broadcasting allows universal functions to deal in a meaningful way with inputs that do not have exactly the same shape."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The first rule of broadcasting is that if all input arrays do not have the same number of dimensions, a \"1\" will be repeatedly prepended to the shapes of the smaller arrays until all the arrays have the same number of dimensions."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The second rule of broadcasting ensures that arrays with a size of 1 along a particular dimension act as if they had the size of the array with the largest shape along that dimension. The value of the array element is assumed to be the same along that dimension for the \"broadcast\" array."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "After application of the broadcasting rules, the sizes of all arrays must match. More details can be found in "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "basics.broadcasting",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "user:basics.broadcasting"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Broadcasting rules"
        }
      ],
      "level": 2,
      "target": "broadcasting-rules"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "NumPy offers more indexing facilities than regular Python sequences. In addition to indexing by integers and slices, as we saw before, arrays can be indexed by arrays of integers and arrays of booleans."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Advanced indexing and index tricks"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(12)**2  # the first 12 square numbers\n>>> i = np.array([1, 1, 3, 8, 5])  # an array of indices\n>>> a[i]  # the elements of `a` at the positions `i`\narray([ 1,  1,  9, 64, 25])\n>>> \n>>> j = np.array([[3, 4], [9, 7]])  # a bidimensional array of indices\n>>> a[j]  # the same shape as `j`\narray([[ 9, 16],\n       [81, 49]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When the indexed array "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is multidimensional, a single array of indices refers to the first dimension of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The following example shows this behavior by converting an image of labels into a color image using a palette."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> palette = np.array([[0, 0, 0],         # black\n...                     [255, 0, 0],       # red\n...                     [0, 255, 0],       # green\n...                     [0, 0, 255],       # blue\n...                     [255, 255, 255]])  # white\n>>> image = np.array([[0, 1, 2, 0],  # each value corresponds to a color in the palette\n...                   [0, 3, 4, 0]])\n>>> palette[image]  # the (2, 4, 3) color image\narray([[[  0,   0,   0],\n        [255,   0,   0],\n        [  0, 255,   0],\n        [  0,   0,   0]],\n<BLANKLINE>\n       [[  0,   0,   0],\n        [  0,   0, 255],\n        [255, 255, 255],\n        [  0,   0,   0]]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "We can also give indexes for more than one dimension. The arrays of indices for each dimension must have the same shape."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(12).reshape(3, 4)\n>>> a\narray([[ 0,  1,  2,  3],\n       [ 4,  5,  6,  7],\n       [ 8,  9, 10, 11]])\n>>> i = np.array([[0, 1],  # indices for the first dim of `a`\n...               [1, 2]])\n>>> j = np.array([[2, 1],  # indices for the second dim\n...               [3, 3]])\n>>> \n>>> a[i, j]  # i and j must have equal shape\narray([[ 2,  5],\n       [ 7, 11]])\n>>> \n>>> a[i, 2]\narray([[ 2,  6],\n       [ 6, 10]])\n>>> \n>>> a[:, j]\narray([[[ 2,  1],\n        [ 3,  3]],\n<BLANKLINE>\n       [[ 6,  5],\n        [ 7,  7]],\n<BLANKLINE>\n       [[10,  9],\n        [11, 11]]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In Python, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "arr[i, j]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is exactly the same as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "arr[(i, j)]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "---so we can put "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "i"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in a "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "tuple"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and then do the indexing with that."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> l = (i, j)\n>>> # equivalent to a[i, j]\n>>> a[l]\narray([[ 2,  5],\n       [ 7, 11]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "However, we can not do this by putting "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "i"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " into an array, because this array will be interpreted as indexing the first dimension of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> s = np.array([i, j])\n>>> # not what we want\n>>> a[s]\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nIndexError: index 3 is out of bounds for axis 0 with size 3\n>>> # same as `a[i, j]`\n>>> a[tuple(s)]\narray([[ 2,  5],\n       [ 7, 11]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Another common use of indexing with arrays is the search of the maximum value of time-dependent series      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> time = np.linspace(20, 145, 5)  # time scale\n>>> data = np.sin(np.arange(20)).reshape(5, 4)  # 4 time-dependent series\n>>> time\narray([ 20.  ,  51.25,  82.5 , 113.75, 145.  ])\n>>> data\narray([[ 0.        ,  0.84147098,  0.90929743,  0.14112001],\n       [-0.7568025 , -0.95892427, -0.2794155 ,  0.6569866 ],\n       [ 0.98935825,  0.41211849, -0.54402111, -0.99999021],\n       [-0.53657292,  0.42016704,  0.99060736,  0.65028784],\n       [-0.28790332, -0.96139749, -0.75098725,  0.14987721]])\n>>> # index of the maxima for each series\n>>> ind = data.argmax(axis=0)\n>>> ind\narray([2, 0, 3, 1])\n>>> # times corresponding to the maxima\n>>> time_max = time[ind]\n>>> \n>>> data_max = data[ind, range(data.shape[1])]  # => data[ind[0], 0], data[ind[1], 1]...\n>>> time_max\narray([ 82.5 ,  20.  , 113.75,  51.25])\n>>> data_max\narray([0.98935825, 0.84147098, 0.99060736, 0.6569866 ])\n>>> np.all(data_max == data.max(axis=0))\nTrue",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "You can also use indexing with arrays as a target to assign to      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(5)\n>>> a\narray([0, 1, 2, 3, 4])\n>>> a[[1, 3, 4]] = 0\n>>> a\narray([0, 0, 2, 0, 0])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "However, when the list of indices contains repetitions, the assignment is done several times, leaving behind the last value      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(5)\n>>> a[[0, 0, 2]] = [1, 2, 3]\n>>> a\narray([2, 1, 3, 3, 4])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This is reasonable enough, but watch out if you want to use Python's "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "+="
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " construct, as it may not do what you expect      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(5)\n>>> a[[0, 0, 2]] += 1\n>>> a\narray([1, 1, 3, 3, 4])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Even though 0 occurs twice in the list of indices, the 0th element is only incremented once. This is because Python requires "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a += 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to be equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a = a + 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Indexing with arrays of indices"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When we index arrays with arrays of (integer) indices we are providing the list of indices to pick. With boolean indices the approach is different; we explicitly choose which items in the array we want and which ones we don't."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The most natural way one can think of for boolean indexing is to use boolean arrays that have "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "the same shape"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " as the original array      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(12).reshape(3, 4)\n>>> b = a > 4\n>>> b  # `b` is a boolean with `a`'s shape\narray([[False, False, False, False],\n       [False,  True,  True,  True],\n       [ True,  True,  True,  True]])\n>>> a[b]  # 1d array with the selected elements\narray([ 5,  6,  7,  8,  9, 10, 11])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This property can be very useful in assignments      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a[b] = 0  # All elements of `a` higher than 4 become 0\n>>> a\narray([[0, 1, 2, 3],\n       [4, 0, 0, 0],\n       [0, 0, 0, 0]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "You can look at the following example to see how to use boolean indexing to generate an image of the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Mandelbrot set"
                }
              ],
              "url": "https://en.wikipedia.org/wiki/Mandelbrot_set",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ":"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import numpy as np\n>>> import matplotlib.pyplot as plt\n>>> def mandelbrot(h, w, maxit=20, r=2):\n...     \"\"\"Returns an image of the Mandelbrot fractal of size (h,w).\"\"\"\n...     x = np.linspace(-2.5, 1.5, 4*h+1)\n...     y = np.linspace(-1.5, 1.5, 3*w+1)\n...     A, B = np.meshgrid(x, y)\n...     C = A + B*1j\n...     z = np.zeros_like(C)\n...     divtime = maxit + np.zeros(z.shape, dtype=int)\n...\n...     for i in range(maxit):\n...         z = z**2 + C\n...         diverge = abs(z) > r                    # who is diverging\n...         div_now = diverge & (divtime == maxit)  # who is diverging now\n...         divtime[div_now] = i                    # note when\n...         z[diverge] = r                          # avoid diverging too much\n...\n...     return divtime\n>>> plt.clf()\n>>> plt.imshow(mandelbrot(400, 400))",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The second way of indexing with booleans is more similar to integer indexing; for each dimension of the array we give a 1D boolean array selecting the slices we want      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(12).reshape(3, 4)\n>>> b1 = np.array([False, True, True])         # first dim selection\n>>> b2 = np.array([True, False, True, False])  # second dim selection\n>>> \n>>> a[b1, :]                                   # selecting rows\narray([[ 4,  5,  6,  7],\n       [ 8,  9, 10, 11]])\n>>> \n>>> a[b1]                                      # same thing\narray([[ 4,  5,  6,  7],\n       [ 8,  9, 10, 11]])\n>>> \n>>> a[:, b2]                                   # selecting columns\narray([[ 0,  2],\n       [ 4,  6],\n       [ 8, 10]])\n>>> \n>>> a[b1, b2]                                  # a weird thing to do\narray([ 4, 10])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that the length of the 1D boolean array must coincide with the length of the dimension (or axis) you want to slice. In the previous example, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " has length 3 (the number of "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "rows"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "), and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (of length 4) is suitable to index the 2nd axis (columns) of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Indexing with boolean arrays"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "ix_",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function can be used to combine different vectors so as to obtain the result for each n-uplet. For example, if you want to compute all the +b\\*c for all the triplets taken from each of the vectors a, b and c      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.array([2, 3, 4, 5])\n>>> b = np.array([8, 5, 4])\n>>> c = np.array([5, 4, 6, 8, 3])\n>>> ax, bx, cx = np.ix_(a, b, c)\n>>> ax\narray([[[2]],\n<BLANKLINE>\n       [[3]],\n<BLANKLINE>\n       [[4]],\n<BLANKLINE>\n       [[5]]])\n>>> bx\narray([[[8],\n        [5],\n        [4]]])\n>>> cx\narray([[[5, 4, 6, 8, 3]]])\n>>> ax.shape, bx.shape, cx.shape\n((4, 1, 1), (1, 3, 1), (1, 1, 5))\n>>> result = ax + bx * cx\n>>> result\narray([[[42, 34, 50, 66, 26],\n        [27, 22, 32, 42, 17],\n        [22, 18, 26, 34, 14]],\n<BLANKLINE>\n       [[43, 35, 51, 67, 27],\n        [28, 23, 33, 43, 18],\n        [23, 19, 27, 35, 15]],\n<BLANKLINE>\n       [[44, 36, 52, 68, 28],\n        [29, 24, 34, 44, 19],\n        [24, 20, 28, 36, 16]],\n<BLANKLINE>\n       [[45, 37, 53, 69, 29],\n        [30, 25, 35, 45, 20],\n        [25, 21, 29, 37, 17]]])\n>>> result[3, 2, 4]\n17\n>>> a[3] + b[2] * c[4]\n17",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "You could also implement the reduce as follows      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> def ufunc_reduce(ufct, *vectors):\n...    vs = np.ix_(*vectors)\n...    r = ufct.identity\n...    for v in vs:\n...        r = ufct(r, v)\n...    return r",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "and then use it as      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> ufunc_reduce(np.add, a, b, c)\narray([[[15, 14, 16, 18, 13],\n        [12, 11, 13, 15, 10],\n        [11, 10, 12, 14,  9]],\n<BLANKLINE>\n       [[16, 15, 17, 19, 14],\n        [13, 12, 14, 16, 11],\n        [12, 11, 13, 15, 10]],\n<BLANKLINE>\n       [[17, 16, 18, 20, 15],\n        [14, 13, 15, 17, 12],\n        [13, 12, 14, 16, 11]],\n<BLANKLINE>\n       [[18, 17, 19, 21, 16],\n        [15, 14, 16, 18, 13],\n        [14, 13, 15, 17, 12]]])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The advantage of this version of reduce compared to the normal ufunc.reduce is that it makes use of the "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "broadcasting rules",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "user:quickstart"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in order to avoid creating an argument array the size of the output times the number of vectors."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "The ix_() function"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "structured_arrays",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "user:basics.rec"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Indexing with strings"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Here we give a list of short and useful tips."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Tricks and tips"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To change the dimensions of an array, you can omit one of the sizes which will then be deduced automatically      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> a = np.arange(30)\n>>> b = a.reshape((2, -1, 3))  # -1 means \"whatever is needed\"\n>>> b.shape\n(2, 5, 3)\n>>> b\narray([[[ 0,  1,  2],\n        [ 3,  4,  5],\n        [ 6,  7,  8],\n        [ 9, 10, 11],\n        [12, 13, 14]],\n<BLANKLINE>\n       [[15, 16, 17],\n        [18, 19, 20],\n        [21, 22, 23],\n        [24, 25, 26],\n        [27, 28, 29]]])",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "\"Automatic\" reshaping"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "How do we construct a 2D array from a list of equally-sized row vectors? In MATLAB this is quite easy: if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "y"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are two vectors of the same length you only need do "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "m=[x;y]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". In NumPy this works via the functions "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "column_stack"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "dstack"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "hstack"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "vstack"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", depending on the dimension in which the stacking is to be done. For example      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> x = np.arange(0, 10, 2)\n>>> y = np.arange(5)\n>>> m = np.vstack([x, y])\n>>> m\narray([[0, 2, 4, 6, 8],\n       [0, 1, 2, 3, 4]])\n>>> xy = np.hstack([x, y])\n>>> xy\narray([0, 2, 4, 6, 8, 0, 1, 2, 3, 4])",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The logic behind those functions in more than two dimensions can be strange."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "seealso",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "seealso "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "numpy-for-matlab-users",
                  "reference": {
                    "__type": "LocalRef",
                    "__tag": 4022,
                    "kind": "docs",
                    "path": "numpy-for-matlab-users"
                  },
                  "kind": "docs"
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Vector stacking"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The NumPy "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "histogram"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function applied to an array returns a pair of vectors: the histogram of the array and a vector of the bin edges. Beware: "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "matplotlib"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " also has a function to build histograms (called "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "hist"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", as in Matlab) that differs from the one in NumPy. The main difference is that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "pylab.hist"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " plots the histogram automatically, while "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "numpy.histogram"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " only generates the data."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import numpy as np\n>>> rg = np.random.default_rng(1)\n>>> import matplotlib.pyplot as plt\n>>> # Build a vector of 10000 normal deviates with variance 0.5^2 and mean 2\n>>> mu, sigma = 2, 0.5\n>>> v = rg.normal(mu, sigma, 10000)\n>>> # Plot a normalized histogram with 50 bins\n>>> plt.hist(v, bins=50, density=True)       # matplotlib version (plot)\n(array...)\n>>> # Compute the histogram with numpy and then plot it\n>>> (n, bins) = np.histogram(v, bins=50, density=True)  # NumPy version (no plot)\n>>> plt.plot(.5 * (bins[1:] + bins[:-1]), n) #doctest: +SKIP",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "With Matplotlib >=3.4 you can also use "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "plt.stairs(n, bins)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Histograms"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Python tutorial"
                        }
                      ],
                      "url": "https://docs.python.org/tutorial/",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "reference",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "reference:index"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "SciPy Tutorial"
                        }
                      ],
                      "url": "https://docs.scipy.org/doc/scipy/tutorial/index.html",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "SciPy Lecture Notes"
                        }
                      ],
                      "url": "https://scipy-lectures.org",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "matlab, R, IDL, NumPy/SciPy dictionary"
                        }
                      ],
                      "url": "https://mathesaurus.sourceforge.net/",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "tutorial-svd",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "numpy-tutorials:tutorial-svd"
                      },
                      "kind": "docs"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Further reading"
        }
      ],
      "level": 1,
      "target": null
    }
  ],
  "local_refs": []
}