파이썬 Numpy 배열 모양 바꾸기(reshape, concatenate, split)
목차 1. reshape 함수 2. concatenate 함수 3. split 함수 1. reshape 함수 numpy.reshape(a, newshape, order='C') a : array_like newshape : int or tuple of ints order : {‘C’, ‘F’, ‘A’}, optional 1 2 3 4 5 6 7 8 9 10 11 import numpy as np a = np.arange(8) print('a.shape =', a.shape, '\n') print('a =', a, '\n') b = a.reshape((2, 4)) print('b.shape =', b.shape, '\n') print('b =', b) cs a.shape = (8,) a = [0 1 2 3..
2023. 4. 2.