numpy user guide
numpy.tile(A,reprs)
numpy.tile(A, reps)
This method will return a max( d, A.ndim) dimension array( d= len( reprs)).
ifd> A.ndim, it will return a d-dimension array by prepending new axes;
etc.
1 | >>>a = np.array([[1,2,3],[1,2,3]]) |
if d< A.ndim, it will return an A.ndim-dimension array by prepending 1’s to it .
For example, for an shape of(1,2,2,3), a reps of (2,3) will be treated as (1,1,2,3)
1 | >>>a = np.array([[[[1,2,3],[1,2,3]]]]) |
numpy.sum()
numpy.sum(a, axis=None, dtype=None, out=None, keepdims=False)
axis
This is a litte complex. abs(axis) must be less than a.ndim.


dtype
1 | >>>b=np.array([0.3,0.4,0.9,1.5,1.9]) |
keepdims
If this parameter is assigned to True, the it will return an array as dimension with the size that input array is
1 | >>>b=np.array([[[0.3,0.4,0.9,1.5,1.9]]]) |
