df =
id_easy latitude longitude
level_0
0 6454 11 3
0 6454 12 4
2 2323 23 5
2 2323 23 7
3 25603 13 5
3 141 14 6
想要绘制:
long
lat
的所有id_easy
和6454
值long
lat
的所有id_easy
和2323
值 len(df)
我的尝试:
for index_in_red in df.index.unique():
plt.plot(df.loc[df.index != index_in_red,'longitude'],df.loc[df.index != index_in_red,'latitude'] ,
color='silver', marker='o',linestyle='')
plt.plot(df.loc[index_in_red,'longitude'],df.loc[index_in_red,'latitude'] ,
color='maroon',marker='o',linestyle='')
plt.show()
所需的输出:
答案 0 :(得分:1)
for i in df.index.unique():
plt.plot(df[df['id_easy'] != i]['longitude'],df[df['id_easy'] != i]['latitude'] ,
color='silver', marker='o',linestyle='')
plt.plot(df[df['id_easy'] != i]['longitude'],df[df['id_easy'] != i]['latitude'] ,
color='maroon',marker='o',linestyle='')
plt.show()