2017-12-02 1 views

답변

0

당신이하고 싶은 일에 대한 최고의 게스트는 배열 복사 및 크기 조정입니다.

# same dimensions as your array 
a=np.random.randn(326) 
# then you can tile (repeat) your array to have the same shape 
# of your other array to do element-wise operations or something else 
b=np.tile(a.reshape(-1,1,1),(1,25,16)) 

가변 b의 형상은 지금 (326, 25, 16)이다.

+0

감사합니다. 이 새로운 배열을 어떻게 CSV 파일에 쓸 수 있습니까? – user8863227

+0

'np.savetxt ("foo.csv", b, 구분자 = ",")' – silgon

관련 문제