{
  "__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:numpy-for-matlab-users",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "NumPy for MATLAB users"
        }
      ],
      "level": 0,
      "target": "numpy-for-matlab-users"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "MATLAB® and NumPy have a lot in common, but NumPy was created to work with Python, not to be a MATLAB clone.  This guide will help MATLAB users get started with NumPy."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Introduction"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Table",
          "__tag": 4065,
          "children": [
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "In MATLAB, the basic type, even for scalars, is a     multidimensional array. Array assignments in MATLAB are stored as     2D arrays of double precision floating point numbers, unless you     specify the number of dimensions and type.  Operations on the 2D     instances of these arrays are modeled on matrix operations in     linear algebra."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "In NumPy, the basic type is a multidimensional "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "array"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ".  Array     assignments in NumPy are usually stored as "
                        },
                        {
                          "__type": "InlineRole",
                          "__tag": 4003,
                          "value": "n-dimensional arrays<arrays>",
                          "domain": null,
                          "role": "ref",
                          "inventory": null
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " with the     minimum type required to hold the objects in sequence, unless you     specify the number of dimensions and type. NumPy performs     operations element-by-element, so multiplying 2D arrays with     "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "*"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " is not a matrix multiplication -- it's an     element-by-element multiplication. (The "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "@"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " operator, available     since Python 3.5, can be used for conventional matrix     multiplication.)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "MATLAB numbers indices from 1; "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(1)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " is the first element.     "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "See note INDEXING",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy, like Python, numbers indices from 0; "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[0]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " is the first     element."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "MATLAB's scripting language was created for linear algebra so the     syntax for some array manipulations is more compact than     NumPy's. On the other hand, the API for adding GUIs and creating     full-fledged applications is more or less an afterthought."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy is  based on Python, a     general-purpose language.  The advantage to NumPy     is access to Python libraries including: "
                        },
                        {
                          "__type": "Link",
                          "__tag": 4049,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "SciPy"
                            }
                          ],
                          "url": "https://www.scipy.org/",
                          "title": ""
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "Link",
                          "__tag": 4049,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Matplotlib"
                            }
                          ],
                          "url": "https://matplotlib.org/",
                          "title": ""
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ",     "
                        },
                        {
                          "__type": "Link",
                          "__tag": 4049,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Pandas"
                            }
                          ],
                          "url": "https://pandas.pydata.org/",
                          "title": ""
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "Link",
                          "__tag": 4049,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "OpenCV"
                            }
                          ],
                          "url": "https://opencv.org/",
                          "title": ""
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ",     and more. In addition, Python is often "
                        },
                        {
                          "__type": "Link",
                          "__tag": 4049,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "embedded as a scripting language"
                            }
                          ],
                          "url": "https://en.wikipedia.org/wiki/List_of_Python_software#Embedded_as_a_scripting_language",
                          "title": ""
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "     in other software, allowing NumPy to be used there too."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "MATLAB array slicing uses pass-by-value semantics, with a lazy     copy-on-write scheme to prevent creating copies until they are     needed. Slicing operations copy parts of the array."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy array slicing uses pass-by-reference, that does not copy     the arguments. Slicing operations are views into an array."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Some key differences"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The table below gives rough equivalents for some common MATLAB expressions. These are similar expressions, not equivalents. For details, see the "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "documentation<reference>",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In the table below, it is assumed that you have executed the following commands in Python:"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "import numpy as np\nfrom scipy import io, integrate, linalg, signal\nfrom scipy.sparse.linalg import cg, eigs",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Also assume below that if the Notes talk about \"matrix\" that the arguments are two-dimensional entities."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Rough equivalents"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Table",
          "__tag": 4065,
          "children": [
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": true,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "MATLAB"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Notes"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "help func"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "info(func)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "help(func)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "func?"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " (in IPython)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "get help on the function "
                        },
                        {
                          "__type": "Emphasis",
                          "__tag": 4047,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "func"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "which func"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "see note HELP",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "find out where "
                        },
                        {
                          "__type": "Emphasis",
                          "__tag": 4047,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "func"
                            }
                          ]
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " is defined"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "type func"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.source(func)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "func??"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " (in IPython)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "print source for "
                        },
                        {
                          "__type": "Emphasis",
                          "__tag": 4047,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "func"
                            }
                          ]
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " (if not a native function)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "% comment"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "# comment"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "comment a line of code with the text "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "comment"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": "for i=1:3\n    fprintf('%i\\n',i)\nend",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": "for i in range(1, 4):\n   print(i)",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "use a for-loop to print the numbers 1, 2, and 3 using "
                        },
                        {
                          "__type": "InlineRole",
                          "__tag": 4003,
                          "value": "range <range>",
                          "domain": "py",
                          "role": "class",
                          "inventory": null
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a && b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a and b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "short-circuiting logical AND operator ("
                        },
                        {
                          "__type": "InlineRole",
                          "__tag": 4003,
                          "value": "Python native operator <python:boolean>",
                          "domain": null,
                          "role": "ref",
                          "inventory": null
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ");     scalar arguments only"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a || b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a or b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "short-circuiting logical OR operator ("
                        },
                        {
                          "__type": "InlineRole",
                          "__tag": 4003,
                          "value": "Python native operator <python:boolean>",
                          "domain": null,
                          "role": "ref",
                          "inventory": null
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ");     scalar arguments only"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": ">> 4 == 4\n    ans = 1\n    >> 4 == 5\n    ans = 0",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": ">>> 4 == 4\nTrue\n>>> 4 == 5\nFalse",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "The "
                        },
                        {
                          "__type": "InlineRole",
                          "__tag": 4003,
                          "value": "boolean objects <python:bltin-boolean-values>",
                          "domain": null,
                          "role": "ref",
                          "inventory": null
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "     in Python are "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "True"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "False"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", as opposed to MATLAB     logical types of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "0"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": "a=4\n    if a==4\n        fprintf('a = 4\\n')\n    elseif a==5\n        fprintf('a = 5\\n')\n    end",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": "a = 4\nif a == 4:\n    print('a = 4')\nelif a == 5:\n    print('a = 5')",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "create an if-else statement to check if "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " is 4 or 5 and print result"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1*i"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1*j"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ",  "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1i"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1j"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1j"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "complex numbers"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "eps"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.finfo(float).eps"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.spacing(1)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "distance from 1 to the next larger representable real number in double     precision"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "load data.mat"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "io.loadmat('data.mat')"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Load MATLAB variables saved to the file "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "data.mat"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ". (Note: When saving arrays to     "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "data.mat"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " in MATLAB/Octave, use a recent binary format. "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "scipy.io.loadmat",
                          "reference": {
                            "__type": "RefInfo",
                            "__tag": 4000,
                            "module": "scipy",
                            "version": "*",
                            "kind": "api",
                            "path": "scipy.io.matlab._mio:loadmat"
                          },
                          "kind": "module"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "     will create a dictionary with the saved arrays and further information.)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "ode45"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "integrate.solve_ivp(f)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "integrate an ODE with Runge-Kutta 4,5"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "ode15s"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "integrate.solve_ivp(f, method='BDF')"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "integrate an ODE with BDF method"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "General purpose equivalents"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Table",
          "__tag": 4065,
          "children": [
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": true,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "MATLAB"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Notes"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "ndims(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.ndim(a)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.ndim"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "number of dimensions of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "numel(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.size(a)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.size"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "number of elements of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "size(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.shape(a)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.shape"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "\"size\" of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "size(a,n)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.shape[n-1]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "get the number of elements of the n-th dimension of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ". (Note     that MATLAB uses 1 based indexing while Python uses 0 based indexing,     See note "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "INDEXING",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ")"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[ 1 2 3; 4 5 6 ]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.array([[1., 2., 3.], [4., 5., 6.]])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "define a 2x3 2D array"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[ a b; c d ]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.block([[a, b], [c, d]])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "construct a matrix from blocks "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "c"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "d"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(end)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[-1]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "access last element in MATLAB vector (1xn or nx1) or 1D NumPy array     "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " (length n)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(2,5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[1, 4]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "access element in second row, fifth column in 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(2,:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[1]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or  "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[1, :]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "entire second row of 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(1:5,:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[0:5]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[:5]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[0:5, :]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "first 5 rows of 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(end-4:end,:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[-5:]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "last 5 rows of 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(1:3,5:9)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[0:3, 4:9]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "The first through third rows and fifth through ninth columns of a 2D array, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a([2,4,5],[1,3])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[np.ix_([1, 3, 4], [0, 2])]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "rows 2,4 and 5 and columns 1 and 3.  This allows the matrix to be     modified, and doesn't require a regular slice."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(3:2:21,:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[2:21:2,:]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "every other row of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", starting with the third and going to the     twenty-first"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(1:2:end,:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[::2, :]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "every other row of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", starting with the first"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(end:-1:1,:)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "  or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "flipud(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[::-1,:]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " with rows in reverse order"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a([1:end 1],:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[np.r_[:len(a),0]]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " with copy of the first row appended to the end"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.'"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.transpose()"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.T"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "transpose of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a'"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.conj().transpose()"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.conj().T"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "conjugate transpose of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a * b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a @ b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "matrix multiply"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a .* b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a * b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "element-wise multiply"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a./b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a/b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "element-wise divide"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.^3"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a**3"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "element-wise exponentiation"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "(a > 0.5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "(a > 0.5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "matrix whose i,jth element is (a_ij > 0.5).  The MATLAB result is an     array of logical values 0 and 1.  The NumPy result is an array of the boolean     values "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "False"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "True"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "find(a > 0.5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.nonzero(a > 0.5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "find the indices where ("
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " > 0.5)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(:,find(v > 0.5))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[:,np.nonzero(v > 0.5)[0]]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "extract the columns of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " where vector v > 0.5"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(:,find(v>0.5))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[:, v.T > 0.5]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "extract the columns of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " where column vector v > 0.5"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(a<0.5)=0"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[a < 0.5]=0"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " with elements less than 0.5 zeroed out"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a .* (a>0.5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a * (a > 0.5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " with elements less than 0.5 zeroed out"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a(:) = 3"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a[:] = 3"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "set all values to the same scalar value"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "y=x"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "y = x.copy()"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy assigns by reference"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "y=x(2,:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "y = x[1, :].copy()"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy slices are by reference"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "y=x(:)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "y = x.flatten()"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "turn array into vector (note that this forces a copy). To obtain the     same data ordering as in MATLAB, use "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "x.flatten('F')"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "1:10"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.arange(1., 11.)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.r_[1.:11.]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or  "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.r_[1:10:10j]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "create an increasing vector (see note "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "RANGES",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ")"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "0:9"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.arange(10.)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or  "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.r_[:10.]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or  "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.r_[:9:10j]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "create an increasing vector (see note "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "RANGES",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ")"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[1:10]'"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.arange(1.,11.)[:, np.newaxis]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "create a column vector"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "zeros(3,4)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.zeros((3, 4))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "3x4 two-dimensional array full of 64-bit floating point zeros"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "zeros(3,4,5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.zeros((3, 4, 5))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "3x4x5 three-dimensional array full of 64-bit floating point zeros"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "ones(3,4)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.ones((3, 4))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "3x4 two-dimensional array full of 64-bit floating point ones"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "eye(3)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.eye(3)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "3x3 identity matrix"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "diag(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.diag(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "returns a vector of the diagonal elements of 2D array, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "diag(v,0)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.diag(v, 0)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "returns a square diagonal matrix whose nonzero values are the elements of     vector, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "v"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": "rng(42,'twister')\n    rand(3,4)",
                      "execution_status": null
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Code",
                      "__tag": 4050,
                      "value": "from numpy.random import default_rng\nrng = default_rng(42)\nrng.random((3, 4))",
                      "execution_status": null
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "or older version: "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "random.rand((3, 4))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "generate a random 3x4 array with default random number generator and     seed = 42"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "linspace(1,3,4)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.linspace(1,3,4)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "4 equally spaced samples between 1 and 3, inclusive"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[x,y]=meshgrid(0:8,0:5)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.mgrid[0:9.,0:6.]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.meshgrid(r_[0:9.],r_[0:6.])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "two 2D arrays: one of x values, the other of y values"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": []
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "ogrid[0:9.,0:6.]"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.ix_(np.r_[0:9.],np.r_[0:6.]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "the best way to eval functions on a grid"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[x,y]=meshgrid([1,2,4],[2,4,5])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.meshgrid([1,2,4],[2,4,5])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": []
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": []
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.ix_([1,2,4],[2,4,5])"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "the best way to eval functions on a grid"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "repmat(a, m, n)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.tile(a, (m, n))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "create m by n copies of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[a b]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.concatenate((a,b),1)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.hstack((a,b))"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or     "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.column_stack((a,b))"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.c_[a,b]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "concatenate columns of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[a; b]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.concatenate((a,b))"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.vstack((a,b))"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.r_[a,b]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "concatenate rows of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "max(max(a))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.max()"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.nanmax(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "maximum element of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " (with ndims(a)<=2 for MATLAB, if there are     NaN's, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "nanmax"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " will ignore these and return largest value)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "max(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.max(0)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "maximum element of each column of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "max(a,[],2)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.max(1)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "maximum element of each row of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "max(a,b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.maximum(a, b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "compares "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " element-wise, and returns the maximum value     from each pair"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "norm(v)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.sqrt(v @ v)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.linalg.norm(v)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "L2 norm of vector "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "v"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a & b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "logical_and(a,b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "element-by-element AND operator (NumPy ufunc) "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "See note     LOGICOPS",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a | b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.logical_or(a,b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "element-by-element OR operator (NumPy ufunc) "
                        },
                        {
                          "__type": "CrossRef",
                          "__tag": 4002,
                          "value": "See note LOGICOPS",
                          "reference": {
                            "__type": "LocalRef",
                            "__tag": 4022,
                            "kind": "docs",
                            "path": "user:numpy-for-matlab-users"
                          },
                          "kind": "exists"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "bitand(a,b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a & b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "bitwise AND operator (Python native and NumPy ufunc)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "bitor(a,b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a | b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "bitwise OR operator (Python native and NumPy ufunc)"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "inv(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "linalg.inv(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "inverse of square 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "pinv(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "linalg.pinv(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "pseudo-inverse of 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "rank(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.linalg.matrix_rank(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "matrix rank of a 2D array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a\\b"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "linalg.solve(a, b)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " if "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " is square; "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "linalg.lstsq(a, b)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "     otherwise"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "solution of a x = b for x"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b/a"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Solve "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.T x.T = b.T"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " instead"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "solution of x a = b for x"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[U,S,V]=svd(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "U, S, Vh = linalg.svd(a); V = Vh.T"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "singular value decomposition of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "chol(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "linalg.cholesky(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Cholesky factorization of a 2D array"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[V,D]=eig(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "D,V = linalg.eig(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "eigenvalues "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "\\lambda"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and eigenvectors "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "v"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ",     where "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "\\mathbf{a} v = \\lambda v"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[V,D]=eig(a,b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "D,V = linalg.eig(a, b)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "eigenvalues "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "\\lambda"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " and eigenvectors "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "v"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " of     "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ", "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "     where "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "\\mathbf{a} v = \\lambda \\mathbf{b} v"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[V,D]=eigs(a,3)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "D,V = eigs(a, k=3)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "find the "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "k=3"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " largest eigenvalues and eigenvectors of 2D array, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[Q,R]=qr(a,0)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "Q,R = linalg.qr(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "QR decomposition"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[L,U,P]=lu(a)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " where "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a==P'*L*U"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "P,L,U = linalg.lu(a)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " where "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a == P@L@U"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "LU decomposition with partial pivoting     (note: P(MATLAB) == transpose(P(NumPy)))"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "conjgrad"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "cg"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "conjugate gradients solver"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "fft(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.fft.fft(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Fourier transform of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "ifft(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.fft.ifft(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "inverse Fourier transform of "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "sort(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.sort(a)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.sort(axis=0)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "sort each column of a 2D array, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "sort(a, 2)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.sort(a, axis=1)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " or "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.sort(axis=1)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "sort the each row of 2D array, "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "[b,I]=sortrows(a,1)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "I = np.argsort(a[:, 0]); b = a[I,:]"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "save the array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " as array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "b"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " with rows sorted by the first column"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "x = Z\\y"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "x = linalg.lstsq(Z, y)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "perform a linear regression of the form "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "\\mathbf{Zx}=\\mathbf{y}"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "decimate(x, q)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "signal.resample(x, np.ceil(len(x)/q))"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "downsample with low-pass filtering"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "unique(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "np.unique(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "a vector of unique values in array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "TableRow",
              "__tag": 4068,
              "header": false,
              "children": [
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "squeeze(a)"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a.squeeze()"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "TableCell",
                  "__tag": 4069,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "remove singleton dimensions of array "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "a"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ". Note that MATLAB will always     return arrays of 2D or higher while NumPy will return arrays of 0D or     higher"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Linear algebra equivalents"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "\\ "
            },
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Submatrix"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ": Assignment to a submatrix can be done with lists of indices using the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ix_"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " command. E.g., for 2D array "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", one might do: "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ind=[1, 3]; a[np.ix_(ind, ind)] += 100"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "\\ "
            },
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "HELP"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ": There is no direct equivalent of MATLAB's "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "which"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " command, but the commands "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "help",
              "domain": null,
              "role": "func",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " will usually list the filename where the function is located. Python also has an "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "inspect"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " module (do "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "import inspect"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ") which provides a "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "getfile"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that often works."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "\\ "
            },
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "INDEXING"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ": MATLAB uses one based indexing, so the initial element of a sequence has index 1. Python uses zero based indexing, so the initial element of a sequence has index 0. Confusion and flamewars arise because each has advantages and disadvantages. One based indexing is consistent with common human language usage, where the \"first\" element of a sequence has index 1. Zero based indexing "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "simplifies indexing"
                }
              ],
              "url": "https://groups.google.com/group/comp.lang.python/msg/1bf4d925dfbf368?q=g:thl3498076713d&hl=en",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". See also "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "a text by prof.dr. Edsger W. Dijkstra"
                }
              ],
              "url": "https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "\\ "
            },
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "RANGES"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ": In MATLAB, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "0:5"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can be used as both a range literal and a 'slice' index (inside parentheses); however, in Python, constructs like "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "0:5"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "only"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " be used as a slice index (inside square brackets). Thus the somewhat quirky "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "r_"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " object was created to allow NumPy to have a similarly terse range construction mechanism. Note that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "r_"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is not called like a function or a constructor, but rather "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "indexed"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " using square brackets, which allows the use of Python's slice syntax in the arguments."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "\\ "
            },
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "LOGICOPS"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ": "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "&"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "|"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in NumPy is bitwise AND/OR, while in MATLAB & and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "|"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are logical AND/OR. The two can appear to work the same, but there are important differences. If you would have used MATLAB's "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "&"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "|"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " operators, you should use the NumPy ufuncs "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "logical_and"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "/"
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "logical_or"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The notable differences between MATLAB's and NumPy's "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "&"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "|"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " operators are:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Non-logical {0,1} inputs: NumPy's output is the bitwise AND of the    inputs. MATLAB treats any non-zero value as 1 and returns the logical    AND. For example "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(3 & 4)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " in NumPy is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", while in MATLAB both "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "3"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "    and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "4"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "    are considered logical true and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(3 & 4)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " returns "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Precedence: NumPy's & operator is higher precedence than logical    operators like "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "<"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": ">"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "; MATLAB's is the reverse."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If you know you have boolean arguments, you can get away with using NumPy's bitwise operators, but be careful with parentheses, like this: "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "z = (x > 1) & (x < 2)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The absence of NumPy operator forms of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "logical_and"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "logical_or"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is an unfortunate consequence of Python's design."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "RESHAPE and LINEAR INDEXING"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ": MATLAB always allows multi-dimensional arrays to be accessed using scalar or linear indices, NumPy does not. Linear indices are common in MATLAB programs, e.g. "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "find()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " on a matrix returns them, whereas NumPy's find behaves differently. When converting MATLAB code it might be necessary to first reshape a matrix to a linear sequence, perform some indexing operations and then reshape back. As reshape (usually) produces views onto the same storage, it should be possible to do this fairly efficiently. Note that the scan order used by reshape in NumPy defaults to the 'C' order, whereas MATLAB uses the Fortran order. If you are simply converting to a linear sequence and back this doesn't matter. But if you are converting reshapes from MATLAB code which relies on the scan order, then this MATLAB code: "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "z = reshape(x,3,4);"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " should become "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "z = x.reshape(3,4,order='F').copy()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in NumPy."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Notes"
        }
      ],
      "level": 1,
      "target": "numpy-for-matlab-users.notes"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Historically, NumPy has provided a special matrix type, "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "np.matrix",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", which is a subclass of ndarray which makes binary operations linear algebra operations. You may see it used in some existing code instead of "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "np.array",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". So, which one to use?"
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "'array' or 'matrix'? Which should I use?"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Use arrays"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "They support multidimensional array algebra that is supported in MATLAB"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "They are the standard vector/matrix/tensor type of NumPy. Many NumPy    functions return arrays, not matrices."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "There is a clear distinction between element-wise operations and    linear algebra operations."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "You can have standard vectors or row/column vectors if you like."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Until Python 3.5 the only disadvantage of using the array type was that you had to use "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "dot"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " instead of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "*"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to multiply (reduce) two tensors (scalar product, matrix vector multiplication etc.). Since Python 3.5 you can use the matrix multiplication "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "@"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " operator."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Given the above, we intend to deprecate "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "matrix"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " eventually."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Short answer"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "NumPy contains both an "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " class and a "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "matrix"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " class. The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " class is intended to be a general-purpose n-dimensional array for many kinds of numerical computing, while "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "matrix"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is intended to facilitate linear algebra computations specifically. In practice there are only a handful of key differences between the two."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Operators "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "*"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "@"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", functions "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "dot()"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "multiply()"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ":"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "For "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "*"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "means element-wise multiplication"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", while       "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "@"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "means matrix multiplication"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "; they have associated functions       "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "multiply()"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " and "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "dot()"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "For "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "*"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "means matrix multiplication"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", and for       element-wise multiplication one has to use the "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "multiply()"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " function."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Handling of vectors (one-dimensional arrays)"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "For "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", the "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "vector shapes 1xN, Nx1, and N are all different\n      things"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ". Operations like "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "A[:,1]"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " return a one-dimensional array of       shape N, not a two-dimensional array of shape Nx1. Transpose on a       one-dimensional "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " does nothing."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "For "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "one-dimensional arrays are always upconverted to 1xN\n      or Nx1 matrices"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " (row or column vectors). "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "A[:,1]"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " returns a       two-dimensional matrix of shape Nx1."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Handling of higher-dimensional arrays (ndim > 2)"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " objects "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "can have number of dimensions > 2"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ";"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " objects "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "always have exactly two dimensions"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Convenience attributes"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "has a .T attribute"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", which returns the transpose of       the data."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "also has .H, .I, and .A attributes"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", which return       the conjugate transpose, inverse, and "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "asarray()"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " of the matrix,       respectively."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Convenience constructor"
                    }
                  ]
                },
                {
                  "__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": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " constructor "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "takes (nested) Python sequences as\n      initializers"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ". As in, "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array([[1,2,3],[4,5,6]])"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " constructor additionally "
                            },
                            {
                              "__type": "Strong",
                              "__tag": 4048,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "takes a convenient\n      string initializer"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ". As in "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix(\"[1 2 3; 4 5 6]\")"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "There are pros and cons to using both:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "array"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Element-wise multiplication is easy: "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "A*B"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " You have to remember that matrix multiplication has its own       operator, "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "@"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " You can treat one-dimensional arrays as "
                            },
                            {
                              "__type": "Emphasis",
                              "__tag": 4047,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "either"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " row or column       vectors. "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "A @ v"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " treats "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "v"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " as a column vector, while       "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "v @ A"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " treats "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "v"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " as a row vector. This can save you having to       type a lot of transposes."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is the \"default\" NumPy type, so it gets the most       testing, and is the type most likely to be returned by 3rd party       code that uses NumPy."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Is quite at home handling data of any number of dimensions."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Closer in semantics to tensor algebra, if you are familiar       with that."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "Emphasis",
                              "__tag": 4047,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "All"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " operations ("
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "*"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "/"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "+"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ", "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "-"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " etc.) are       element-wise."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Sparse matrices from "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "scipy.sparse"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " do not interact as well       with arrays."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "matrix"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":\\\\"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Behavior is more like that of MATLAB matrices."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "<:("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Maximum of two-dimensional. To hold three-dimensional data you       need "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " or perhaps a Python list of "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "<:("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Minimum of two-dimensional. You cannot have vectors. They must be       cast as single-column or single-row matrices."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "<:("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Since "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is the default in NumPy, some functions may       return an "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "array"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " even if you give them a "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "matrix"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " as an       argument. This shouldn't happen with NumPy functions (if it does       it's a bug), but 3rd party code based on NumPy may not honor type       preservation like NumPy does."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": ":)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "A*B"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is matrix multiplication, so it looks just like you write       it in linear algebra (For Python >= 3.5 plain arrays have the same       convenience with the "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "@"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " operator)."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "<:("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " Element-wise multiplication requires calling a function,       "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "multiply(A,B)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "<:("
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " The use of operator overloading is a bit illogical: "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "*"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "       does not work element-wise but "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "/"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " does."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Interaction with "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "scipy.sparse"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is a bit cleaner."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "array"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is thus much more advisable to use.  Indeed, we intend to deprecate "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "matrix"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " eventually."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Long answer"
        }
      ],
      "level": 2,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In MATLAB the main tool available to you for customizing the environment is to modify the search path with the locations of your favorite functions. You can put such customizations into a startup script that MATLAB will run on startup."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "NumPy, or rather Python, has similar facilities."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "To modify your Python search path to include the locations of your    own modules, define the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "PYTHONPATH"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " environment variable."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "To have a particular script file executed when the interactive Python    interpreter is started, define the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "PYTHONSTARTUP"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " environment    variable to contain the name of your startup script."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Unlike MATLAB, where anything on your path can be called immediately, with Python you need to first do an 'import' statement to make functions in a particular file accessible."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For example you might make a startup script that looks like this (Note: this is just an example, not a statement of \"best practices\"):"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "# Make all numpy available via shorter 'np' prefix\nimport numpy as np\n#\n# Make the SciPy linear algebra functions available as linalg.func()\n# e.g. linalg.lu, linalg.eig (for general l*B@u==A@u solution)\nfrom scipy import linalg\n#\n# Define a Hermitian function\ndef hermitian(A, **kwargs):\n    return np.conj(A,**kwargs).T\n# Make a shortcut for hermitian:\n#    hermitian(A) --> H(A)\nH = hermitian",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To use the deprecated "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "matrix",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and other "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "matlib",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " functions:"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "# Make all matlib functions accessible at the top level via M.func()\nimport numpy.matlib as M\n# Make some matlib functions accessible directly at the top level via, e.g. rand(3,3)\nfrom numpy.matlib import matrix,rand,zeros,ones,empty,eye",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Customizing your environment"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Another somewhat outdated MATLAB/NumPy cross-reference can be found at https://mathesaurus.sf.net/"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "An extensive list of tools for scientific work with Python can be found in the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "topical software page"
                }
              ],
              "url": "https://projects.scipy.org/topical-software.html",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "List of Python software: scripting"
                }
              ],
              "url": "https://en.wikipedia.org/wiki/List_of_Python_software#Embedded_as_a_scripting_language",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for a list of software that use Python as a scripting language"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "MATLAB® and SimuLink® are registered trademarks of The MathWorks, Inc."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Links"
        }
      ],
      "level": 1,
      "target": null
    }
  ],
  "local_refs": []
}