{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": "samples",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "There are "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "num"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " equally spaced samples in the closed interval "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "[start, stop]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or the half-open interval "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "[start, stop)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (depending on whether "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "endpoint"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is True or False)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "step",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Only returned if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "retstep"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is True"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Size of spacing between samples."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Return evenly spaced numbers over a specified interval."
            }
          ]
        }
      ],
      "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": "start",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The starting value of the sequence."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "stop",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The end value of the sequence, unless "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "endpoint"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is set to False. In that case, the sequence consists of all but the last of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "num + 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " evenly spaced samples, so that "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "stop"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is excluded.  Note that the step size changes when "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "endpoint"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is False."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "num",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Number of samples to generate. Default is 50. Must be non-negative."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "endpoint",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "stop"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the last sample. Otherwise, it is not included. Default is True."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "retstep",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, return ("
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "samples",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "samples"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "step",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "step"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "), where "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "step",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "step"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the spacing between samples."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "dtype",
              "annotation": "dtype, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The type of the output array.  If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "dtype"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not given, the data type is inferred from "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "start"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "stop"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". The inferred dtype will never be an integer; "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "float",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is chosen even if the arguments would produce an array of integers."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "axis",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The axis in the result to store the samples.  Relevant only if start or stop are array-like.  By default (0), the samples will be along a new axis inserted at the beginning. Use -1 to get an axis at the end."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "device",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The device on which to place the created array. Default: None. For Array-API interoperability only, so must be "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "\"cpu\""
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " if passed."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 2.0.0"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Returns "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "num"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " evenly spaced samples, calculated over the interval ["
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "start"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "stop"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "]."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The endpoint of the interval can optionally be excluded."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionchanged",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionchanged 1.20.0"
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Values are rounded towards "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "-inf"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " instead of "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "0"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " when an integer "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "dtype"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " is specified. The old behavior can still be obtained with "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "np.linspace(start, stop, num).astype(int)"
                }
              ]
            }
          ]
        }
      ],
      "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": "/numpy/_core/function_base.py",
  "item_line": 27,
  "item_type": "_ArrayFunctionDispatcher",
  "aliases": [
    "numpy.linspace"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nnp.linspace(2.0, 3.0, num=5)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.linspace(2.0, 3.0, num=5, endpoint=False)\nnp.linspace(2.0, 3.0, num=5, retstep=True)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nGraphical illustration:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import matplotlib.pyplot as plt\nN = 8\ny = np.zeros(N)\nx1 = np.linspace(0, 10, N, endpoint=True)\nx2 = np.linspace(0, 10, N, endpoint=False)\nplt.plot(x1, y, 'o')\nplt.plot(x2, y + 0.5, 'o')\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.ylim([-0.5, 1])\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success"
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "numpy",
          "version": "2.4.3",
          "kind": "assets",
          "path": "fig-7e99eb20b3ab7b51.png"
        }
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "arange",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "arange"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Similar to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "linspace",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but uses a step size (instead of the number of samples)."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "geomspace",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "geomspace"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Similar to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "linspace",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but with numbers spaced evenly on a log scale (a geometric progression)."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "how-to-partition",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "how-to-partition"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "ref"
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "logspace",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "logspace"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Similar to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "geomspace",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but with the end points specified as logarithms."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "start",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "stop",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "num",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "50"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "endpoint",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "True"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "retstep",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "False"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "dtype",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "axis",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "0"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "device",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "linspace"
  },
  "references": null,
  "qa": "numpy:linspace",
  "arbitrary": [],
  "local_refs": [
    "axis",
    "device",
    "dtype",
    "endpoint",
    "num",
    "retstep",
    "samples",
    "start",
    "step",
    "stop"
  ]
}