test_array = np.array([1,4,5,8], float)
#또는
list1 = [[1,4,5,8], [2,3,6,7]]
array1 = np.array(list1, int)

Rank(차원)은 3개. != Dimensionality
(열, 행, 채널) 순으로 표시합니다
x = np.array([[1, 2, 5, 8], [1, 2, 5, 8]])
[[1 2 5 8][1 2 5 8]]
x = x.reshape(-1,)
x
x = x.reshape(4,2)
x
[1 2 5 8 1 2 5 8 ]
[[1 2 ][ 5 8 ]
[ 1 2 ][ 5 8 ]]
x = x.reshape(2, -1)
x
[[1 2 5 8
1 2 5 8]]
-1로 입력하면 알아서 사이즈를 찾아간다
x = x.flatten()
x
[1 2 5 8 1 2 5 8]
#arange(start,stop,step)
np.arange(5,0,-1)
np.ones(shape=5,2), dtype=np.int8)
np.zeros(shape=2,2), dtype=np.float32)
np.empty(shape=2,4), dtype=np.float32) # 초기화되지 않은 무작위 배열 생성
x = np.arange(12).reshape(3,4)
#x와 같은 배열의 1 또는 0 생성
np.ones_like(x)
np.zeros_like(x)
np.identity(n=4, dtype=int) # I 생성

#Identity Matrix지만 정사각형이 아닌 행렬 생성
np.eye(N,M)
#k는 기본값이 0이고 n번째부터 diagonal의 대각선 요소 추출
np.diag(matrix, k=1)