title: Change 3d array to 4d array numpy
body: <p>From following code, I have got 'log_specgrams' with shape (20,1,12060). 
  I want to change the shape to (20, 60, 201, 1). 
  So I wrote the code like this. </p>
  
  <pre><code>log_specgrams = np.asarray(log_specgrams).reshape(len(log_specgrams), 60, 201, 1)
  </code></pre>
  
  <p>But I gave an error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:/for-test.py", line 26, in &lt;module&gt;
      features = extract_features(parent_dir,sub_dirs)
    File "D:/for-test.py", line 17, in extract_features
      log_specgrams = np.asarray(log_specgrams).reshape(len(log_specgrams), 60, 201, 1)
    File "C:\Users\CHS\Anaconda3\lib\site-packages\numpy\core\numeric.py", line 482, in asarray
      return array(a, dtype, copy=False, order=order)
  ValueError: could not broadcast input array from shape (12060) into shape (1)
  (1, 12060)
  </code></pre>
  
  <p>The whole code: </p>
  
  <pre><code>import glob
  import os
  import librosa
  import numpy as np
  
  def extract_features(parent_dir, sub_dirs, file_ext="*.wav"):
          log_specgrams = []
          for l, sub_dir in enumerate(sub_dirs):
                  for fn in glob.glob(os.path.join(parent_dir, sub_dir, file_ext)):
                          X_in, sample_rate = librosa.load(fn)
                          melspec = librosa.feature.melspectrogram(y=X_in, sr=sample_rate, n_fft=1024, hop_length=441, n_mels=60)
                          logmel = librosa.logamplitude(melspec)
                          logmel = logmel.T.flatten()[:, np.newaxis].T
                          log_specgrams.append(logmel)
  
          print(np.shape(logmel))
          log_specgrams = np.asarray(log_specgrams).reshape(len(log_specgrams), 60, 201, 1)
          print(np.shape(log_specgrams))
          A = features
  
          return np.array(log_specgrams)
  
  
  parent_dir = 'Sound-Data_small'
  sub_dirs= ['fold1','fold2']
  features = extract_features(parent_dir,sub_dirs)
  </code></pre>
  
  <p>I really want to change the shape of 'log_specgrams', (20,1,12060) to (20, 60, 201, 1). </p>