How to add column to numpy array

前端 未结 4 2060
北海茫月
北海茫月 2020-12-02 14:09

I am trying to add one column to the array created from recfromcsv. In this case it\'s an array: [210,8] (rows, cols).

I want to add a nint

4条回答
  •  -上瘾入骨i
    2020-12-02 14:56

    I add a new column with ones to a matrix array in this way:

    Z = append([[1 for _ in range(0,len(Z))]], Z.T,0).T
    

    Maybe it is not that efficient?

提交回复
热议问题