0

if I have a array with (10,) and (373,) for each 10 dim, how can I change this matrix into (10,373)?

thx for answering

Firerock
  • 9
  • 3

1 Answers1

0

Here's a naive solution that would work:

import numpy as np # you have to have numpy installed

some_array = np.random.randn(373,)
rows = 10
cols = 373
# this is your new array of desired shape:
new_array = np.empty([rows, cols])

# fill it up:
for i_th_row in range(rows):
    new_array[i_th_row,:] = some_array

So,

>>> new_array.shape
(10, 373)

How to install numpy can be found here.

Sever
  • 25
  • 2
  • 7