title: TypeError: Required argument 'object' (pos 1) not found
body: <p>I am a beginner and facing an error in my code:</p>
  
  <p>This error was resolved:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/ankitchaudhari/PycharmProjects/Learn/datascience/gg.py", line 26, in &lt;module&gt;
      label = kmeans(data, k)
    File "/Users/ankitchaudhari/PycharmProjects/Learn/datascience/gg.py", line 20, in kmeans
      labels = KMeans(n_clusters=k).fit_predict(data)
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/cluster/k_means_.py", line 830, in fit_predict
      return self.fit(X).labels_
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/cluster/k_means_.py", line 812, in fit
      X = self._check_fit_data(X)
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/cluster/k_means_.py", line 787, in _check_fit_data
      if X.shape[0] &lt; self.n_clusters:
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>but the new error is:
  new error:     d = np.array()</p>
  
  <p>TypeError: Required argument 'object' (pos 1) not found</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  import pandas as pd
  
  import numpy as np
  
  from sklearn.cluster import KMeans
  
  data = np.array([[1, 2],
               [5, 8],
               [1.5, 1.8],
               [8, 8],
               [9, 11],
               [1, 0.6],
               [2, 2]])
  
  k = np.array([2, 10])
  
  df = pd.DataFrame(data)
  
  df
  
  def kmeans(data, i):
  
      labels = KMeans(n_clusters=k).fit_predict(data)
      return labels
  
  sse = 0
  
  for i in k:
  
      label = kmeans(data, k)
      cluster_mean = df.mean()
      d = np.array([])
      for j in range(len(label)):
          sse += sum(pow((data[j]) - cluster_mean, 2))
          d.append(sse)
  
  plt.plot(d, k)
  plt.show()
  </code></pre>
  
  <p>The Previous error was solved. Please help me with this error.</p>