2017-12-02 7 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

関連する問題