Python Numpy
NumPy v1.10 Manual
http://docs.scipy.org/doc/numpy-1.10.1/index.htmlSearch page
http://docs.scipy.org/doc/numpy/search.htmlNumpy for Matlab users
http://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html#numpy-for-matlab-users相信有許多人是想利用Python Numpy 來取代Matlab的一些功能,譬如科學計算、畫圖等,上面是官方釋出給從Matlab轉過來使用Numpy的使用者手冊。所以有使用過Matlab的人可以先看這篇,相信可以更快上手Numpy。
numpy.ndarray.shape
範例:
numpy.unique(ar, return_index=False, return_inverse=False,return_counts=False)
http://docs.scipy.org/doc/numpy/reference/generated/numpy.unique.html#numpy-uniqueFind the unique elements of an array.找出陣列中所有不同的元素。
範例:
In[128]: ar = [1,1,2,3,4,2,3,4,6,6,7,2,1,3,1,1,2,3,5,5,3]
In[129]: np.unique(a)
Out[129]: array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
numpy.meshgrid(*xi, **kwargs)
http://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html#numpy-meshgridReturn coordinate matrices from coordinate vectors.
範例:
>>> X, Y = np.meshgrid([1,2,3], [4,5,6,7]) >>> X array([[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]) >>> Y array([[4, 4, 4], [5, 5, 5], [6, 6, 6], [7, 7, 7]])
numpy.ravel(a, order='C')
http://docs.scipy.org/doc/numpy/reference/generated/numpy.ravel.html#numpy-ravel
Return a contiguous flattened array.
等同於 reshape(-1,order = order)
It is equivalent to reshape(-1, order=order).numpy.cov(m, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None)
https://docs.scipy.org/doc/numpy/reference/generated/numpy.cov.html
https://docs.scipy.org/doc/numpy/reference/routines.linalg.html
Estimate a covariance matrix, given data and weights.
Covariance indicates the level to which two variables vary together. If we examine N-dimensional samples, , then the covariance matrix element is the covariance of and . The element is the variance of .
Linear algebra (numpy.linalg)
https://docs.scipy.org/doc/numpy/reference/routines.linalg.html- Matrix and vector products
- Decompositions
- Matrix eigenvalues
linalg.eig(a) Compute the eigenvalues and right eigenvectors of a square array.
- Norms and other numbers
- Solving equations and inverting matrices
- Exceptions
沒有留言:
張貼留言