在python3.5中导入Kmeans的错误

时间:2017-07-30 16:13:27

标签: python scikit-learn

In [1]: import sqlite3

In [2]: import pandas as pd

In [3]: import numpy as np

In [4]: import matplotlib.pyplot as plt
In [5]: from sklearn.cluster import Kmeans
ImportError                               Traceback (most recent call last)
<ipython-input-5-0125bea01c25> in <module>()
----> 1 from sklearn.cluster import Kmeans

ImportError: cannot import name 'Kmeans'

Scikit-learn版本为0.18.2

1 个答案:

答案 0 :(得分:2)

这只是一个错字。 KMeans中的“m”应该是资本:

from sklearn.cluster import KMeans