{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Keywords other than "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "dtype"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "like"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are passed to "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "function"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "fromfunction: MaskedArray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The result of the call to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "function"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is passed back directly. Therefore the shape of "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "fromfunction",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "numpy:fromfunction"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is completely determined by "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "function"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".  If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "function"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " returns a scalar value, the shape of "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "fromfunction",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "numpy:fromfunction"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " would not match the "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "shape"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " parameter."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Construct an array by executing a function over each coordinate."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "function",
              "annotation": "callable",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The function is called with N parameters, where N is the rank of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "shape"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".  Each parameter represents the coordinates of the array varying along a specific axis.  For example, if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "shape"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " were "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(2, 2)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", then the parameters would be "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "array([[0, 0], [1, 1]])"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "array([[0, 1], [0, 1]])"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "shape",
              "annotation": "(N,) tuple of ints",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Shape of the output array, which also determines the shape of the coordinate arrays passed to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "function"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "dtype",
              "annotation": "data-type, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Data-type of the coordinate arrays passed to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "function"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". By default, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "dtype"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is float."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "like",
              "annotation": "array_like, optional",
              "desc": [
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Reference object to allow the creation of arrays which are not     NumPy arrays. If an array-like passed in as "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "like"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " supports     the "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "__array_function__"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " protocol, the result will be defined     by it. In this case, it ensures the creation of an array object     compatible with that passed in via this argument."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.20.0"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The resulting array therefore has a value "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "fn(x, y, z)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " at coordinate "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "(x, y, z)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py",
  "item_line": 8749,
  "item_type": "function",
  "aliases": [
    "numpy.ma.fromfunction"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nnp.fromfunction(lambda i, j: i, (2, 2), dtype=float)\n",
        "execution_status": "none"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.fromfunction(lambda i, j: j, (2, 2), dtype=float)\n",
        "execution_status": "none"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.fromfunction(lambda i, j: i == j, (3, 3), dtype=int)\n",
        "execution_status": "none"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.fromfunction(lambda i, j: i + j, (3, 3), dtype=int)\n",
        "execution_status": "none"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "indices",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy:indices"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "meshgrid",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy:meshgrid"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "function",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "shape",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "dtype",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "<class 'float'>"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "like",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "kwargs",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "VAR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "fromfunction"
  },
  "references": null,
  "qa": "numpy.ma.core:fromfunction",
  "arbitrary": [],
  "local_refs": [
    "dtype",
    "function",
    "like",
    "shape"
  ]
}