tag*_*aga 1 python google-maps
我编写了一个数据科学代码,并得到了一些我想在谷歌地图上绘制的坐标。这些是坐标,所有这些坐标都位于塞尔维亚首都贝尔格莱德。
X Y
20.657460 44.490140
20.510760 44.652443
20.510540 44.884460
20.471758 44.788613
20.359841 44.742405
20.472120 44.763520
20.610525 44.676290
Run Code Online (Sandbox Code Playgroud)
如何在谷歌地图上绘制这些数据,以便我可以在谷歌地图上看到这些坐标的位置?我尝试使用 matplotlib、一些 Santdex 教程和pygmaps但失败了。我无法安装pygmaps
小智 5
您可以使用gmplot通过 Google 地图绘制数据。
为此,请安装pip install gmplot.
然后,代码应如下所示:
from gmplot import gmplot
# Initialize the map at a given point
gmap = gmplot.GoogleMapPlotter(37.766956, -122.438481, 13)
# Add a marker
gmap.marker(37.770776, -122.461689, 'cornflowerblue')
# Draw map into HTML file
gmap.draw("my_map.html")
Run Code Online (Sandbox Code Playgroud)
您可以查看gmplot repo以了解如何使用它。