Numpy Slice
數組的運算子:==,!=,~,&,|
數組軸對換 Axis Change
| 一元ufunc | |
| abs, fabs | 計算絕對值 absolute value |
| sqrt | 平方根 square root |
| square | 平方 |
| exp | 指數 expoent |
| log, log10, log2, log1p | 自然對數 natural logarithm 底數:e, 10, 2, (1+x) |
| sign | 各元素的正負號:1(正數), 0 (零), -1(負數) |
| ceil | 計算該值的最大整數 |
| floor | 計算該值的最小整數 |
| rint | 四捨五入 |
| modf | 以獨立數值的方式回傳數組的小數和整數部份 |
| isnan | 回傳哪些值不是Nan的Boolean數組 |
| isfinite, isinf | 單傳哪些值是有限值的Boolean數組 |
| cos, cosh, sin, sinh, tan,tanh | 三角函式 |
| arccos, arccosh, arcsin, arcsinh, arctan, arctanh | 反三角函式 |
| logical_not | 計算各元素not x的真值 |
| add | 各元素相加 |
| substract | 各元素相減 |
| multiply | 各元素相乘 |
| divide, floor_divide | 除法或丟去餘數 |
| power | 求數值的N次方 |
| maximum, fmax | 求數值中的最大值 |
| minimum, fmin | 求數值中的最小值 |
| mod | 除法的餘數 |
| copysign | 將第二數組中的值符號Copy給第一數組 |
| greater, greater_equal, less, less_equal, equal, no_equal, logical_and, logical_or, logical_xor | >, >=, <, <=, =, !=, &, I, ^ |
Meshgrid
The purpose of meshgrid is to create a rectangular grid out of an array of x values and an array of y values.
np.where
統計方法
| sum | 求總合 |
| mean | 求平均值 |
| std, var | 求標準差和方差 |
| min, max | 最小值和最大值 |
| argmin, argmax | 最小值的索引值和最大值的索引值 |
| cumsum | 與前一欄的值累相加 |
| cumprod | 與前一欄的值累相乘 |