Python Numpy Shape Basics Usage
The shape function is a function in Numpy.core.fromnumeric, whose function is to read the length of the matrix, for example, Shape[0] is to read the length of the first dimension of the matrix. Its input parameters can make an integer representation of a dimension, or it can be a matrix. So you may not understand it, but we use a variety of examples to illustrate his usage:
- one-dimensional matrices [1] return value is (1L,)
- a two-dimensional matrix that returns two values
- a single number, the return value is null
- We can also call shape as a matrix method, and the following creates a unit matrix E
- we can quickly read the shape of E
- if we only want to read the first dimensional length of E, use shape[0]
Python Numpy Shape Basics Usage (transfer from others ' blogs, such as those involving infringement, please contact me)