scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
derivative(func, x0, dx=1.0, n=1, args=(), order=3)

Given a function, use a central difference formula with spacing dx to compute the nth derivative at :None:None:`x0`.

Notes

Decreasing the step size too small can result in round-off error.

Parameters

func : function

Input function.

x0 : float

The point at which the nth derivative is found.

dx : float, optional

Spacing.

n : int, optional

Order of the derivative. Default is 1.

args : tuple, optional

Arguments

order : int, optional

Number of points to use, must be odd.

Find the nth derivative of a function at a point.

Examples

>>> from scipy.misc import derivative
... def f(x):
...  return x**3 + x**2
... derivative(f, 1.0, dx=1e-6) 4.9999999999217337
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.misc._common.derivative

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/misc/_common.py#75
type: <class 'function'>
Commit: