數(shù)學(xué)函數(shù)
三角函數(shù)
- sin(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算三角正弦函數(shù)缓淹。
- cos(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算三角余弦函數(shù)。
- tan(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算三角正切函數(shù)祖搓。
- arcsin(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算三角反正弦函數(shù)。
- arccos(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算三角反余弦函數(shù)。
- arctan(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算三角反正切函數(shù)。
- hypot(x1, x2, /[, out, where, casting, …]) 給定直角三角形的“腿”囱晴,返回它的斜邊。
- arctan2(x1, x2, /[, out, where, casting, …]) 元素弧切線x1/x2正確選擇象限瓢谢。
- degrees(x, /[, out, where, casting, order, …]) 將角度從弧度轉(zhuǎn)換為度數(shù)速缆。
- radians(x, /[, out, where, casting, order, …]) 將角度從度數(shù)轉(zhuǎn)換為弧度。
- unwrap(p[, discont, axis]) 通過(guò)將值之間的差值更改為2*pi補(bǔ)碼來(lái)展開(kāi)恩闻。
- deg2rad(x, /[, out, where, casting, order, …]) 將角度從度數(shù)轉(zhuǎn)換為弧度。
- rad2deg(x, /[, out, where, casting, order, …]) 將角度從弧度轉(zhuǎn)換為度數(shù)剧董。
雙曲函數(shù)
- sinh(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算雙曲正弦函數(shù)幢尚。
- cosh(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算雙曲余弦函數(shù)。
- tanh(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算雙曲正切函數(shù)翅楼。
- arcsinh(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算逆雙曲正弦函數(shù)尉剩。
- arccosh(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算逆雙曲正弦函數(shù)。
- arctanh(x, /[, out, where, casting, order, …]) 逐個(gè)元素運(yùn)算逆雙曲正弦函數(shù)毅臊。
小數(shù)操作
- around(a[, decimals, out]) 按給定的小數(shù)位數(shù)均勻地四舍五入理茎。
- round_(a[, decimals, out]) 將數(shù)組舍入到給定的小數(shù)位數(shù)。
- rint(x, /[, out, where, casting, order, …]) 將數(shù)組的元素舍入為最接近的整數(shù)。
- fix(x[, out]) 向零舍入到最接近的整數(shù)皂林。
- floor(x, /[, out, where, casting, order, …]) 逐個(gè)元素返回輸入的下限朗鸠。
- ceil(x, /[, out, where, casting, order, …]) 逐個(gè)元素返回輸入的上限。
- trunc(x, /[, out, where, casting, order, …]) 逐個(gè)元素返回輸入的截?cái)嘀怠?/li>
求總和, 求乘積, 求差異
- prod(a[, axis, dtype, out, keepdims]) 返回給定軸上的數(shù)組元素的乘積础倍。
- sum(a[, axis, dtype, out, keepdims]) 給定軸上的數(shù)組元素的總和烛占。
- nanprod(a[, axis, dtype, out, keepdims]) 返回給定軸上的數(shù)組元素的乘積,將非數(shù)字(NaN)視為1沟启。
- nansum(a[, axis, dtype, out, keepdims]) 返回給定軸上的數(shù)組元素的總和忆家,將非數(shù)字(NaN)視為零。
- cumprod(a[, axis, dtype, out]) 返回給定軸上元素的累積乘積德迹。
- cumsum(a[, axis, dtype, out]) 返回給定軸上元素的累積和芽卿。
- nancumprod(a[, axis, dtype, out]) 返回給定軸上的數(shù)組元素的累積乘積,將非數(shù)字(NaN)視為一個(gè)胳搞。
- nancumsum(a[, axis, dtype, out]) 返回給定軸上的數(shù)組元素的累積和卸例,將非數(shù)字(NaN)視為零。
- diff(a[, n, axis]) 計(jì)算沿給定軸的第n個(gè)離散差流酬。
- ediff1d(ary[, to_end, to_begin]) 數(shù)組的連續(xù)元素之間的差異币厕。
- gradient(f, *varargs, **kwargs) 返回N維數(shù)組的漸變。
- cross(a, b[, axisa, axisb, axisc, axis]) 返回兩個(gè)(數(shù)組)向量的叉積芽腾。
- trapz(y[, x, dx, axis]) 沿給定的軸積分使用復(fù)合梯形規(guī)則運(yùn)算旦装。
指數(shù)和對(duì)數(shù)
- exp(x, /[, out, where, casting, order, …]) 計(jì)算輸入數(shù)組中所有元素的指數(shù)。
- expm1(x, /[, out, where, casting, order, …]) 計(jì)算數(shù)組中所有元素的exp(X)-1摊滔。
- exp2(x, /[, out, where, casting, order, …]) 為輸入數(shù)組中的所有p計(jì)算2**p阴绢。
- log(x, /[, out, where, casting, order, …]) 逐個(gè)元素計(jì)算自然對(duì)數(shù)。
- log10(x, /[, out, where, casting, order, …]) 逐個(gè)元素計(jì)算返回輸入數(shù)組的以10為底的對(duì)數(shù)艰躺。
- log2(x, /[, out, where, casting, order, …]) 以-2為底的對(duì)數(shù)呻袭。
- log1p(x, /[, out, where, casting, order, …]) 逐個(gè)元素計(jì)算返回一個(gè)自然對(duì)數(shù)加上輸入數(shù)組。
- logaddexp(x1, x2, /[, out, where, casting, …]) 輸入的指數(shù)之和的對(duì)數(shù)腺兴。
- logaddexp2(x1, x2, /[, out, where, casting, …]) 以-2為基的輸入的指數(shù)和的對(duì)數(shù)左电。
其他的特殊函數(shù)
- i0(x) 修正的第一類貝塞爾函數(shù),0階页响。
- sinc(x) 返回sinc函數(shù)篓足。
浮點(diǎn)數(shù)操作
- signbit(x, /[, out, where, casting, order, …]) 返回元素為T(mén)rue設(shè)置signbit(小于零)。
- copysign(x1, x2, /[, out, where, casting, …]) 逐個(gè)元素將x1的符號(hào)改為x2的符號(hào)闰蚕。
- frexp(x[, out1, out2], / [[, out, where, …]) 將x的元素分解成尾數(shù)和TWOS指數(shù)栈拖。
- ldexp(x1, x2, /[, out, where, casting, …]) 逐個(gè)元素返回x12x2。
- nextafter(x1, x2, /[, out, where, casting, …]) 逐個(gè)元素返回x1后的下一個(gè)浮點(diǎn)值到x2没陡。
- spacing(x, /[, out, where, casting, order, …]) 返回x與最近鄰數(shù)之間的距離涩哟。
算術(shù)運(yùn)算
- add(x1, x2, /[, out, where, casting, order, …]) 按元素添加參數(shù)索赏。
- reciprocal(x, /[, out, where, casting, …]) 逐元素計(jì)算返回參數(shù)的倒數(shù)。
- positive(x, /[, out, where, casting, order, …]) 逐元素正數(shù)計(jì)算
- negative(x, /[, out, where, casting, order, …]) 逐元素負(fù)數(shù)計(jì)算
- multiply(x1, x2, /[, out, where, casting, …]) 逐元素參數(shù)相乘
- divide(x1, x2, /[, out, where, casting, …]) 逐元素方式返回輸入的真正除法贴彼。
- power(x1, x2, /[, out, where, casting, …]) 逐元素將第一個(gè)數(shù)組元素從第二個(gè)數(shù)組提升到冪潜腻。
- subtract(x1, x2, /[, out, where, casting, …]) 逐元素參數(shù)相減。
- true_divide(x1, x2, /[, out, where, …]) 按元素返回輸入的真實(shí)相除锻弓。
- floor_divide(x1, x2, /[, out, where, …]) 返回小于或等于輸入除法的最大整數(shù)砾赔。
- float_power(x1, x2, /[, out, where, …]) 逐元素將第一個(gè)數(shù)組元素從第二個(gè)數(shù)組提升到冪。
- fmod(x1, x2, /[, out, where, casting, …]) 返回除法的元素余數(shù)青灼。
- mod(x1, x2, /[, out, where, casting, order, …]) 返回除法元素的余數(shù)暴心。
- modf(x[, out1, out2], / [[, out, where, …]) 以元素方式返回?cái)?shù)組的分?jǐn)?shù)和整數(shù)部分。
- remainder(x1, x2, /[, out, where, casting, …]) 返回除法元素的余數(shù)杂拨。
- divmod(x1, x2[, out1, out2], / [[, out, …]) 同時(shí)返回逐元素的商和余數(shù)专普。
Handling complex numbers
- angle(z[, deg]) 返回復(fù)雜參數(shù)的角度。
- real(val) 返回復(fù)雜參數(shù)的實(shí)部弹沽。
- imag(val) 返回復(fù)雜參數(shù)的虛部檀夹。
- conj(x, /[, out, where, casting, order, …]) 以元素方式返回復(fù)共軛。
雜項(xiàng)
- convolve(a, v[, mode]) 返回兩個(gè)一維序列的離散線性卷積策橘。
- clip(a, a_min, a_max[, out]) 剪輯(限制)數(shù)組中的值炸渡。
- sqrt(x, /[, out, where, casting, order, …]) 逐個(gè)元素返回?cái)?shù)組的正平方根桨昙。
- cbrt(x, /[, out, where, casting, order, …]) 逐個(gè)元素返回?cái)?shù)組的立方根芹缔。
- square(x, /[, out, where, casting, order, …]) 返回輸入的元素方塊。
- absolute(x, /[, out, where, casting, order, …]) 逐個(gè)元素地計(jì)算絕對(duì)值契沫。
- fabs(x, /[, out, where, casting, order, …]) 逐個(gè)元素計(jì)算絕對(duì)值沛婴。
- sign(x, /[, out, where, casting, order, …]) 返回?cái)?shù)字符號(hào)的元素指示吼畏。
- heaviside(x1, x2, /[, out, where, casting, …]) 計(jì)算Heaviside階躍函數(shù)。
- maximum(x1, x2, /[, out, where, casting, …]) 取數(shù)組中最大的元素嘁灯。
- minimum(x1, x2, /[, out, where, casting, …]) 取數(shù)組中最小的元素泻蚊。
- fmax(x1, x2, /[, out, where, casting, …]) 取數(shù)組中最大的元素。
- fmin(x1, x2, /[, out, where, casting, …]) 取數(shù)組中最小的元素丑婿。
- nan_to_num(x[, copy]) 將nan替換為零性雄,使用大的有限數(shù)替換inf。
- real_if_close(a[, tol]) 如果復(fù)雜輸入返回真實(shí)數(shù)組羹奉,如果復(fù)雜零件接近于零毅贮。
- interp(x, xp, fp[, left, right, period]) 一維線性插值。