---------------------------------------------------------------------------
OverflowError Traceback (most recent call last)
<ipython-input-15-03c9259e3c72> in <module>()
----> 1 modelkmean = doKMeans(df)
2 modelkmean
<ipython-input-14-ee6747502054> in doKMeans(data, clusters)
63 from sklearn.cluster import KMeans
64 model = KMeans(clusters)
---> 65 model.fit(data)
66
67 # Hint: Just like with doPCA above, you will have to create a variable called
//anaconda/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in fit(self, X, y)
887 tol=self.tol, random_state=random_state, copy_x=self.copy_x,
888 n_jobs=self.n_jobs, algorithm=self.algorithm,
--> 889 return_n_iter=True)
890 return self
891
//anaconda/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in k_means(X, n_clusters, init, precompute_distances, n_init, max_iter, verbose, tol, random_state, copy_x, n_jobs, algorithm, return_n_iter)
343 X, n_clusters, max_iter=max_iter, init=init, verbose=verbose,
344 precompute_distances=precompute_distances, tol=tol,
--> 345 x_squared_norms=x_squared_norms, random_state=random_state)
346 # determine if these results are the best so far
347 if best_inertia is None or inertia < best_inertia:
//anaconda/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in _kmeans_single_elkan(X, n_clusters, max_iter, init, verbose, x_squared_norms, random_state, tol, precompute_distances)
392 # init
393 centers = _init_centroids(X, n_clusters, init, random_state=random_state,
--> 394 x_squared_norms=x_squared_norms)
395 centers = np.ascontiguousarray(centers)
396 if verbose:
//anaconda/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in _init_centroids(X, k, init, random_state, x_squared_norms, init_size)
679 if isinstance(init, string_types) and init == 'k-means++':
680 centers = _k_init(X, k, random_state=random_state,
--> 681 x_squared_norms=x_squared_norms)
682 elif isinstance(init, string_types) and init == 'random':
683 seeds = random_state.permutation(n_samples)[:k]
//anaconda/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in _k_init(X, n_clusters, x_squared_norms, random_state, n_local_trials)
88 # specific results for other than mentioning in the conclusion
89 # that it helped.
---> 90 n_local_trials = 2 + int(np.log(n_clusters))
91
92 # Pick first center randomly
OverflowError: cannot convert float infinity to integer