title: ValueError: could not broadcast input array from shape (13,41) into shape (13)
body: <p>I am trying to use tslearn library to analyze an audio numpy file. The file has a 45K row (45K audio samples) and 1 column, but each row has a nested object of (N,13). So the length of each sample is different while the features are the same (13 features). I want to stretch them all to 93 rows, which means if I print the shape of any of them, it will return (93,13).</p>
  
  <p>data example: 
  first nested object in the dataset, shape (43,13) 
  <a href="https://i.stack.imgur.com/58FaN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/58FaN.jpg" alt="enter image description here"></a></p>
  
  <p>second nested object in the dataset, shape (30,13)
  <a href="https://i.stack.imgur.com/8eB60.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8eB60.jpg" alt="enter image description here"></a></p>
  
  <p>I tried to use this tslearn library: <a href="https://tslearn.readthedocs.io/en/latest/gen_modules/preprocessing/tslearn.preprocessing.TimeSeriesResampler.html#tslearn.preprocessing.TimeSeriesResampler" rel="nofollow noreferrer">https://tslearn.readthedocs.io/en/latest/gen_modules/preprocessing/tslearn.preprocessing.TimeSeriesResampler.html#tslearn.preprocessing.TimeSeriesResampler</a></p>
  
  <p>but it will only change the column instead of the row. so basically if I have an array that is (44,13), it will change the array shape to (44,93) instead of (93.13). So I tried to rotate the array for 90 degrees and redo the analysis, but since the dataset itself is only 1D with 45K nested object, I had to make an empty list, use for loop to take out each object, rotate them 90 degrees and put them back to the list. Then I tried to change the list back to an array since the tslearn.preprocessing.TimeSeriesResampler only accepts array as parameters. However, it tells me that 'ValueError: could not broadcast input array from shape (13,41) into shape (13)' while trying to transfer the list back to an array.</p>
  
  <pre><code>import numpy as np
  spoken_train = np.load("spoken_train.npy", allow_pickle=True) 
  lis = []
    for i in range(len(spoken_train)):
    lis.append(np.rot90(spoken_train[i])) 
  myarray = np.asarray(lis)
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-65-440f2eba9eba&gt; in &lt;module&gt;
        2 for i in range(len(spoken_train)):
        3     lis.append(np.rot90(spoken_train[i]))
  ----&gt; 4 myarray = np.asarray(lis)
  
  /anaconda3/lib/python3.7/site-packages/numpy/core/numeric.py in asarray(a, dtype, order)
      536 
      537     """
  --&gt; 538     return array(a, dtype, copy=False, order=order)
      539 
      540 
  
  ValueError: could not broadcast input array from shape (13,41) into shape (13)
  </code></pre>
  
  <p>What should I do? If there is any easier way to rotate the nested array, please let me know as well. Thank you!</p>