標籤:

int class, a.__int__(), np.shape, a.shape, np.zeros, np.arange

import numpy as npnfrom inspect import getmodule, getsourcelinesn# int()當作 floor()使用nhelp(int) # int 是class,ndir(int) # int()更像是__int__()nx = 9.9nx.__int__()nint(x)n(-x).__abs__()nabs(-x)nint("2")nint("2.3")nint(2.7)nint(np.array([2.9])) # array is oknnnnp.shapendir(np.shape) # 沒有什麼特別的nhelp(np.shape)nna = np.array([1,2])ntype(a)nnp.ndarraynhelp(np.ndarray)# classndir(np.ndarray) # shape is a data descriptornhelp(np.ndarray.shape) # a.shape的用法 descriptorngetsourcelines(np.shape) # 用a.shape構建了np.shape()nnnnp.zerosnhelp(np.zeros)ngetsourcelines(np.ndarray) # builtin object, cant see source, C or Fortran ngetsourcelines(np.zeros) # builtin func, cant see source, C or Fortranngetsourcelines(np.arange) # builtin func, cant see source, C or Fortrannnp.arangenhelp(np.arange)n

推薦閱讀:

np ufunc: reduce, accumulate, at; np.add, multiply, sum
ImagePy教程 —— 形態學
ImagePy教程 —— 直方圖調整
python下numpy不成功,請問有沒有簡單的安裝方法?

TAG:numpy |