{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "k"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " derivatives are specified at a breakpoint "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the constructed polynomial is exactly "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "k"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " times continuously differentiable at "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", unless the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "order"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is provided explicitly. In the latter case, the smoothness of the polynomial at the breakpoint is controlled by the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "order"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Deduces the number of derivatives to match at each end from "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "order"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and the number of derivatives available. If possible it uses the same number of derivatives from each end; if the number is odd it tries to take the extra one from y2. In any case if not enough derivatives are available at one end or another it draws enough to make up the total from the other end."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If the order is too high and not enough derivatives are available, an exception is raised."
            }
          ]
        }
      ],
      "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": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Construct a piecewise polynomial in the Bernstein basis, compatible with the specified values and derivatives at breakpoints."
            }
          ]
        }
      ],
      "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": "xi",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "sorted 1-D array of x-coordinates"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "yi",
              "annotation": "array_like or list of array_likes",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "yi[i][j]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "j"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "th derivative known at "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xi[i]"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "orders",
              "annotation": "None or int or array_like of ints. Default: None.",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Specifies the degree of local polynomials. If not None, some derivatives are ignored."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "extrapolate",
              "annotation": "bool or 'periodic', optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If bool, determines whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs. If 'periodic', periodic extrapolation is used. Default is True."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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/_interpolate.py",
  "item_line": 1632,
  "item_type": "classmethod",
  "aliases": [
    "scipy.interpolate.BPoly.from_derivatives"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.interpolate import BPoly\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "BPoly.from_derivatives([0, 1], [[1, 2], [3, 4]])\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCreates a polynomial `f(x)` of degree 3, defined on ``[0, 1]``\nsuch that `f(0) = 1, df/dx(0) = 2, f(1) = 3, df/dx(1) = 4`\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "BPoly.from_derivatives([0, 1, 2], [[0, 1], [0], [2]])\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCreates a piecewise polynomial `f(x)`, such that\n`f(0) = f(1) = 0`, `f(2) = 2`, and `df/dx(0) = 1`.\nBased on the number of derivatives provided, the order of the\nlocal polynomials is 2 on ``[0, 1]`` and 1 on ``[1, 2]``.\nNotice that no restriction is imposed on the derivatives at\n``x = 1`` and ``x = 2``.\n\nIndeed, the explicit form of the polynomial is::\n\n    f(x) = | x * (1 - x),  0 <= x < 1\n           | 2 * (x - 1),  1 <= x <= 2\n\nSo that f'(1-0) = -1 and f'(1+0) = 2"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "scipy.interpolate._interpolate:BPoly.from_derivatives",
  "arbitrary": [],
  "local_refs": [
    "extrapolate",
    "orders",
    "xi",
    "yi"
  ]
}