title: sklearn - KMeans of arrays: ValueError: setting an array element with a sequence
body: <p>I am trying to do KMeans Clusterin over multidimensional features. I get ValueError: setting an array element with a sequence.</p>
  
  <p>Here is an example of what I have already tried:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  from sklearn.cluster import KMeans
  
  test = pd.DataFrame(np.random.randint(low=0, high=10, size=(30, 4)), columns=['a', 'b', 'c', 'd'])
  test["combined1"] = test.loc(axis=1)["a","b"].values.tolist()
  test["combined2"] = test.loc(axis=1)["c","d"].values.tolist()
  test.drop(['a', 'b', 'c', 'd'],axis=1, inplace=True)
  test.head()
  
  kmeans = KMeans(n_clusters=3, random_state=0)
  kmeans.fit(test)
  </code></pre>
  
  <p>The KMeans fit fails with</p>
  
  <pre><code>/usr/local/lib/python3.5/dist-packages/numpy/core/numeric.py in asarray(a, dtype, order)
      490 
      491     """
  --&gt; 492     return array(a, dtype, copy=False, order=order)
      493 
      494 
  
  ValueError: setting an array element with a sequence.
  </code></pre>