我正在尝试将纬度和经度进行聚类。
代码在plt.scatter(data['Lng'],data['Lat'])
行中给出了错误
错误是:
AttributeError: module 'matplotlib' has no attribute 'scatter'
代码:
import numpy as np
import pandas as pd
import matplotlib as plt
import seaborn as sns
sns.set()
from sklearn.cluster import KMeans
data = pd.read_csv("pk.csv")
data.head()
lat_long = data.drop(['country', 'iso2','admin', 'capital','population',
'population_proper'] , axis = 1)
lat_long.head()
plt.scatter(data['Lng'],data['Lat']) # error here
答案 0 :(得分:1)
应该是:
import matplotlib.pyplot as plt
答案 1 :(得分:0)