Numpy. section4 : ndarray 바꾸기. Lec14. ndarray의 flattening

timekeeep·2023년 2월 23일
0

Numpy

목록 보기
13/28

[1] ndarray.flatten

M = np.arange(27)
N = M.reshape((3,3,3))
O = N.flatten()

N0, N1, N2 = N[0], N[1], N[2]
  • N0 N1 N2 순으로 flatten이 진행된다
  • 인덱싱,flatten, reshape 할때도 바깥쪽 차원에서부터 진행된다

[2] ndarray.ravel

  • ravel도 tensor를 받아서 vector로 만들어주는 api이다.
profile
Those who are wise will shine like the brightness of the heavens, and those who lead many to righteousness, like the stars for ever and ever

0개의 댓글