{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Array API Standard Support"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "spalde",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.interpolate._fitpack_py:spalde"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is not in-scope for support of Python Array API Standard compatible backends other than NumPy."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "dev-arrayapi",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for more information."
            }
          ]
        }
      ],
      "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": "results",
              "annotation": "{ndarray, list of ndarrays}",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An array (or a list of arrays) containing all derivatives up to order k inclusive for each point "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", being the first element the spline itself."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Evaluate a B-spline and all its derivatives at one point (or set of points) up to order k (the degree of the spline), being 0 the spline itself."
            }
          ]
        }
      ],
      "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": "x",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A point or a set of points at which to evaluate the derivatives. Note that "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "t(k) <= x <= t(n-k+1)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must hold for each "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "tck",
              "annotation": "tuple",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A tuple (t,c,k) containing the vector of knots, the B-spline coefficients, and the degree of the spline whose derivatives to compute."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/interpolate/_fitpack_py.py",
  "item_line": 569,
  "item_type": "function",
  "aliases": [
    "scipy.interpolate.spalde"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "To calculate the derivatives of a B-spline there are several aproaches. \nIn this example, we will demonstrate that `spalde` is equivalent to\ncalling `splev` and `splder`.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import BSpline, spalde, splder, splev\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tck = ((-2, -2, -2, -2, -1, 0, 1, 2, 2, 2, 2),  # knots\n       (0, 0, 0, 6, 0, 0, 0),  # coefficients\n       3)  # degree (cubic)\nbspl = BSpline(tck[0], tck[1], tck[2])\nx = np.linspace(min(tck[0]), max(tck[0]), 100)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nEvaluate the curve and all derivatives\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "f1_y_bsplin = [spalde(i, tck)[0] for i in x ]  # The B-spline itself\nf1_y_deriv1 = [spalde(i, tck)[1] for i in x ]  # 1st derivative\nf1_y_deriv2 = [spalde(i, tck)[2] for i in x ]  # 2nd derivative\nf1_y_deriv3 = [spalde(i, tck)[3] for i in x ]  # 3rd derivative\nf2_y_deriv3 = splev(x, bspl, der=3)\nf3_y_deriv3 = splder(bspl, n=3)(x)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(16, 5))\nsuptitle = fig.suptitle(f'Evaluate a B-spline and all derivatives')\norders = range(4)\nlinetypes = ['-', '--', '-.', ':']\nlabels = ['B-Spline', '1st deriv.', '2nd deriv.', '3rd deriv.']\nfunctions = ['splev()', 'splder()', 'spalde()']\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "for order, linetype, label in zip(orders, linetypes, labels):\n    ax1.plot(x, splev(x, bspl, der=order), linetype, label=label)\n    ax2.plot(x, splder(bspl, n=order)(x), linetype, label=label)\n    ax3.plot(x, [spalde(i, tck)[order] for i in x], linetype, label=label)\nfor ax, function in zip((ax1, ax2, ax3), functions):\n    ax.set_title(function)\n    ax.legend()\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.tight_layout()\nplt.show()\n",
        "execution_status": "success"
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "1.17.1",
          "kind": "assets",
          "path": "fig-33f58c9b302475d3.png"
        }
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "BivariateSpline",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.interpolate._fitpack2:BivariateSpline"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "UnivariateSpline",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.interpolate._fitpack2:UnivariateSpline"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "bisplev",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.interpolate._fitpack_impl:bisplev"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "bisplrep",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.interpolate._fitpack_impl:bisplrep"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "splev",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "splev"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "splint",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "splint"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "splprep",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "splprep"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "splrep",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "splrep"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "sproot",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "sproot"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "x",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "tck",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "spalde"
  },
  "references": [
    ".. [1] de Boor C : On calculating with b-splines, J. Approximation Theory",
    "   6 (1972) 50-62.",
    ".. [2] Cox M.G. : The numerical evaluation of b-splines, J. Inst. Maths",
    "   applics 10 (1972) 134-149.",
    ".. [3] Dierckx P. : Curve and surface fitting with splines, Monographs on",
    "   Numerical Analysis, Oxford University Press, 1993."
  ],
  "qa": "scipy.interpolate._fitpack_py:spalde",
  "arbitrary": [],
  "local_refs": [
    "results",
    "tck",
    "x"
  ]
}