如何僅展平numpy數組的某些維度 - How to flatten only some dimensions of a numpy array

問題:

Is there a quick way to "sub-flatten" or flatten only some of the first dimensions in a numpy array? 有沒有一種快速的方法來“平整”或平整一些numpy數組中的第一個維度?

For example, given a numpy array of dimensions (50,100,25) , the resultant dimensions would be (5000,25) 例如,給定一個numpy維數(50,100,25) ,結果維數爲(5000,25)


解決方案:

參考: https://stackoom.com/en/question/1GhkE
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章