목록전체 글 (25)
나름개발블로그
파이썬 넘파이
파이썬 넘파이!! 자주 쓰이는 걸 찾아서 모양 변경(reshape) 3D array to 2D a = np.array( [[[8, 4, 1, 0, 0], [6, 8, 5, 5, 2], [1, 1, 1, 1, 1]], [[8, 7, 1, 0, 3], [2, 8, 5, 5, 2], [1, 1, 1, 1, 1]], [[2, 4, 0, 2, 3], [2, 5, 5, 3, 2], [1, 1, 1, 1, 1]]]) a.transpose([1,0,2]).reshape(3,15) >> array([[8, 4, 1, 0, 0, 8, 7, 1, 0, 3, 2, 4, 0, 2, 3], [6, 8, 5, 5, 2, 2, 8, 5, 5, 2, 2, 5, 5, 3, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ..
A/Python
2018. 7. 17. 10:24