title: ValueError: cannot copy sequence with size 2070 to array axis with dimension 2
body: <h2>Trying to perform k means clustering by appending multiple csv files with time series data.
  But getting below error
  104
  {2070}</h2>
  <p>ValueError                                Traceback (most recent call last)
   in 
  71 km = TimeSeriesKMeans(n_clusters=cluster_count, metric=&quot;dtw&quot;)
  72
  ---&gt; 73 labels = km.fit_predict(mySeries)</p>
  <p>~\anaconda3\lib\site-packages\tslearn\clustering\kmeans.py in fit_predict(self, X, y)
  810             Index of the cluster each sample belongs to.
  811         &quot;&quot;&quot;
  --&gt; 812         X = check_array(X, allow_nd=True, force_all_finite='allow-nan')
  813         return self.fit(X, y).labels_
  814</p>
  <p>~\anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
  529                     array = array.astype(dtype, casting=&quot;unsafe&quot;, copy=False)
  530                 else:
  --&gt; 531                     array = np.asarray(array, order=order, dtype=dtype)
  532             except ComplexWarning:
  533                 raise ValueError(&quot;Complex data not supported\n&quot;</p>
  <p>~\AppData\Roaming\Python\Python37\site-packages\numpy\core_asarray.py in asarray(a, dtype, order)
  83
  84     &quot;&quot;&quot;
  ---&gt; 85     return array(a, dtype, copy=False, order=order)
  86
  87</p>
  <p>ValueError: cannot copy sequence with size 2070 to array axis with dimension 2</p>
  <p>My code is:</p>
  <pre><code>for filename in os.listdir(directory):
      if filename.endswith(&quot;.csv&quot;):
          df = pd.read_csv(directory+filename)
  mySeries.append(df)
          namesofMySeries.append(filename[:-2])
  print(len(mySeries))
  series_lengths = {len(series) for series in mySeries}
  print(series_lengths)
  cluster_count = math.ceil(math.sqrt(len(mySeries))) 
  
  km = TimeSeriesKMeans(n_clusters=cluster_count, metric=&quot;dtw&quot;)
  
  labels = km.fit_predict(mySeries)
  </code></pre>