本文簡要介紹 python 語言中 scipy.misc.derivative
的用法。
用法:
scipy.misc.derivative(func, x0, dx=1.0, n=1, args=(), order=3)#
求函數在某一點的 n 階導數。
給定一個函數,使用間距為 dx 的中心差分公式計算 x0 處的第 n 個導數。
- func: 函數
輸入函數。
- x0: 浮點數
找到第 n 個導數的點。
- dx: 浮點數,可選
間距。
- n: 整數,可選
導數的順序。默認值為 1。
- args: 元組,可選
參數
- order: 整數,可選
要使用的點數,必須是奇數。
參數 ::
注意:
將步長減小得太小會導致舍入誤差。
例子:
>>> from scipy.misc import derivative >>> def f(x): ... return x**3 + x**2 >>> derivative(f, 1.0, dx=1e-6) 4.9999999999217337
相關用法
- Python SciPy misc.ascent用法及代碼示例
- Python SciPy misc.face用法及代碼示例
- Python SciPy misc.central_diff_weights用法及代碼示例
- Python SciPy misc.electrocardiogram用法及代碼示例
- Python SciPy mstats.trim用法及代碼示例
- Python SciPy matlab.loadmat用法及代碼示例
- Python SciPy mstats.winsorize用法及代碼示例
- Python SciPy mstats.argstoarray用法及代碼示例
- Python SciPy matlab.savemat用法及代碼示例
- Python SciPy mstats.trima用法及代碼示例
- Python SciPy mstats.tmin用法及代碼示例
- Python SciPy mstats.tmax用法及代碼示例
- Python SciPy mstats.kruskalwallis用法及代碼示例
- Python SciPy mstats.sem用法及代碼示例
- Python SciPy mstats.zscore用法及代碼示例
- Python SciPy mstats.zmap用法及代碼示例
- Python SciPy mstats.mode用法及代碼示例
- Python SciPy mstats.hmean用法及代碼示例
- Python SciPy mstats.variation用法及代碼示例
- Python SciPy mstats.compare_medians_ms用法及代碼示例
- Python SciPy mstats.gmean用法及代碼示例
- Python SciPy mstats.pearsonr用法及代碼示例
- Python SciPy mstats.kruskal用法及代碼示例
- Python SciPy mstats.tmean用法及代碼示例
- Python SciPy mstats.mquantiles用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.misc.derivative。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。