各种方便的numpy命令


  1. np.isinf, np.isnan, np.isneginf, np.isposinf
  2. array.clip(min=0)
  3. np.interp
  4. np.set_printoptions(threshold='nan')
  5. array.sum, array.min, array.cumsum
  6. np.fromfunction
  7. np.floor, np.ceil
  8. np.vstack, np.hstack
  9. np.vsplot, np.hsplit
  10. no copy: a=b 改b,a也变; shallow copy : a = b.view() 改b的数据,a的数据也变 ; deep copy: a = b.copy() 改b,a不变。
  11. np.ix_

 

Array Creationarange, array, copy, empty, empty_like, eye, fromfile, fromfunction, identity,linspace, logspace, mgrid, ogrid, ones, ones_like, r, zeros, zeros_like

Conversionsndarray.astype, atleast_1d, atleast_2d, atleast_3d, mat

Manipulationsarray_split, column_stack, concatenate, diagonal, dsplit, dstack, hsplit, hstack,ndarray.item, newaxis, ravel, repeat, reshape, resize, squeeze, swapaxes, take,transpose, vsplit, vstack

Questionsall, any, nonzero, where

Orderingargmax, argmin, argsort, max, min, ptp, searchsorted, sort

Operationschoose, compress, cumprod, cumsum, inner, ndarray.fill, imag, prod, put,putmask, real, sum

Basic Statisticscov, mean, std, var

Basic Linear Algebracross, dot, outer, linalg.svd, vdot

From https://docs.scipy.org/doc/numpy-dev/user/quickstart.html

  • tedoreve

    评论: 肯定还有好多,慢慢积累吧

    2017-03-28 21:25:54          回复