{"id":1096321,"date":"2025-01-08T15:00:07","date_gmt":"2025-01-08T07:00:07","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1096321.html"},"modified":"2025-01-08T15:00:10","modified_gmt":"2025-01-08T07:00:10","slug":"%e7%bb%99%e5%87%ba%e5%9c%b0%e7%90%86%e5%9d%90%e6%a0%87python%e4%b8%ad%e5%a6%82%e4%bd%95%e5%ae%9a%e4%bd%8d-3","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1096321.html","title":{"rendered":"\u7ed9\u51fa\u5730\u7406\u5750\u6807python\u4e2d\u5982\u4f55\u5b9a\u4f4d"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24211556\/ffd87241-e543-43b5-af6f-2cc54744ce25.webp\" alt=\"\u7ed9\u51fa\u5730\u7406\u5750\u6807python\u4e2d\u5982\u4f55\u5b9a\u4f4d\" \/><\/p>\n<p><h3>\u5f00\u5934\u6bb5\u843d\uff1a<\/h3>\n<\/p>\n<p><p><strong>\u5229\u7528Python\u7684\u5730\u7406\u5750\u6807\u5b9a\u4f4d\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5730\u7406\u6570\u636e\u7684\u5904\u7406\u548c\u5206\u6790\u3001\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u3001\u53ef\u89c6\u5316\u5730\u7406\u4fe1\u606f\u3002<\/strong>\u5728\u8fd9\u4e9b\u5e94\u7528\u4e2d\uff0c\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u5c24\u4e3a\u91cd\u8981\u3002\u5730\u7406\u7f16\u7801\u662f\u5c06\u5730\u5740\u8f6c\u6362\u4e3a\u5730\u7406\u5750\u6807\u7684\u8fc7\u7a0b\uff0c\u800c\u53cd\u5411\u5730\u7406\u7f16\u7801\u5219\u662f\u5c06\u5730\u7406\u5750\u6807\u8f6c\u6362\u4e3a\u5730\u5740\u7684\u8fc7\u7a0b\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5728Python\u4e2d\u5982\u4f55\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\uff0c\u5e76\u4e14\u5c55\u793a\u4e00\u4e9b\u5b9e\u9645\u7684\u4ee3\u7801\u793a\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u6b63\u6587\uff1a<\/h3>\n<\/p>\n<p><h4>\u4e00\u3001\u5730\u7406\u6570\u636e\u7684\u5904\u7406\u548c\u5206\u6790<\/h4>\n<\/p>\n<p><p>\u5730\u7406\u6570\u636e\u7684\u5904\u7406\u548c\u5206\u6790\u5728\u8bb8\u591a\u9886\u57df\u4e2d\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5e93\u6765\u5904\u7406\u548c\u5206\u6790\u5730\u7406\u6570\u636e\uff0c\u5982Geopandas\u3001Shapely\u548cFiona\u7b49\u3002\u8fd9\u4e9b\u5e93\u4f7f\u5f97\u6211\u4eec\u80fd\u591f\u8f7b\u677e\u5730\u8bfb\u53d6\u3001\u5904\u7406\u548c\u53ef\u89c6\u5316\u5730\u7406\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p><strong>1. Geopandas\u7684\u4f7f\u7528<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>Geopandas\u662f\u4e00\u4e2a\u57fa\u4e8ePandas\u7684\u6269\u5c55\u5e93\uff0c\u4e13\u95e8\u7528\u4e8e\u5904\u7406\u5730\u7406\u6570\u636e\u3002\u5b83\u4f7f\u5f97\u5730\u7406\u6570\u636e\u7684\u64cd\u4f5c\u50cf\u5904\u7406Pandas DataFrame\u4e00\u6837\u7b80\u5355\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import geopandas as gpd<\/p>\n<h2><strong>\u8bfb\u53d6Shapefile<\/strong><\/h2>\n<p>gdf = gpd.read_file(&quot;path\/to\/shapefile.shp&quot;)<\/p>\n<h2><strong>\u6253\u5370\u524d\u51e0\u884c\u6570\u636e<\/strong><\/h2>\n<p>print(gdf.head())<\/p>\n<h2><strong>\u8ba1\u7b97\u6bcf\u4e2a\u51e0\u4f55\u5bf9\u8c61\u7684\u9762\u79ef<\/strong><\/h2>\n<p>gdf[&#39;area&#39;] = gdf[&#39;geometry&#39;].area<\/p>\n<h2><strong>\u8ba1\u7b97\u6bcf\u4e2a\u51e0\u4f55\u5bf9\u8c61\u7684\u5468\u957f<\/strong><\/h2>\n<p>gdf[&#39;perimeter&#39;] = gdf[&#39;geometry&#39;].length<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. Shapely\u7684\u4f7f\u7528<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>Shapely\u662f\u4e00\u4e2a\u7528\u4e8e\u64cd\u4f5c\u548c\u5206\u6790\u51e0\u4f55\u5bf9\u8c61\u7684\u5e93\u3002\u5b83\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u548c\u64cd\u4f5c\u70b9\u3001\u7ebf\u3001\u591a\u8fb9\u5f62\u7b49\u51e0\u4f55\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from shapely.geometry import Point, LineString, Polygon<\/p>\n<h2><strong>\u521b\u5efa\u70b9\u5bf9\u8c61<\/strong><\/h2>\n<p>point = Point(1, 1)<\/p>\n<h2><strong>\u521b\u5efa\u7ebf\u5bf9\u8c61<\/strong><\/h2>\n<p>line = LineString([(0, 0), (1, 1), (1, 2)])<\/p>\n<h2><strong>\u521b\u5efa\u591a\u8fb9\u5f62\u5bf9\u8c61<\/strong><\/h2>\n<p>polygon = Polygon([(0, 0), (1, 1), (1, 0)])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u4e8c\u3001\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801<\/h4>\n<\/p>\n<p><p>\u5730\u7406\u7f16\u7801\u662f\u5c06\u5730\u5740\u8f6c\u6362\u4e3a\u5730\u7406\u5750\u6807\u7684\u8fc7\u7a0b\uff0c\u800c\u53cd\u5411\u5730\u7406\u7f16\u7801\u5219\u662f\u5c06\u5730\u7406\u5750\u6807\u8f6c\u6362\u4e3a\u5730\u5740\u7684\u8fc7\u7a0b\u3002Python\u63d0\u4f9b\u4e86\u591a\u4e2a\u5e93\u6765\u5b9e\u73b0\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\uff0c\u5982Geopy\u3001Geocoder\u548cGoogle Maps API\u7b49\u3002<\/p>\n<\/p>\n<p><p><strong>1. Geopy\u7684\u4f7f\u7528<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>Geopy\u662f\u4e00\u4e2aPython\u5e93\uff0c\u7528\u4e8e\u8fdb\u884c\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u3002\u5b83\u652f\u6301\u591a\u4e2a\u5730\u7406\u7f16\u7801\u670d\u52a1\uff0c\u5982Nominatim\u3001Google Maps\u3001Bing Maps\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from geopy.geocoders import Nominatim<\/p>\n<p>geolocator = Nominatim(user_agent=&quot;geoapi&quot;)<\/p>\n<h2><strong>\u5730\u7406\u7f16\u7801<\/strong><\/h2>\n<p>location = geolocator.geocode(&quot;1600 Amphitheatre Parkway, Mount<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n View, CA&quot;)<\/p>\n<p>print((location.latitude, location.longitude))<\/p>\n<h2><strong>\u53cd\u5411\u5730\u7406\u7f16\u7801<\/strong><\/h2>\n<p>location = geolocator.reverse(&quot;37.4219999, -122.0840575&quot;)<\/p>\n<p>print(location.address)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u4f7f\u7528Google Maps API<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>Google Maps API\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u529f\u80fd\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u7684googlemaps\u5e93\u6765\u8bbf\u95ee\u8fd9\u4e9b\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import googlemaps<\/p>\n<h2><strong>\u521d\u59cb\u5316Google Maps\u5ba2\u6237\u7aef<\/strong><\/h2>\n<p>gmaps = googlemaps.Client(key=&#39;YOUR_API_KEY&#39;)<\/p>\n<h2><strong>\u5730\u7406\u7f16\u7801<\/strong><\/h2>\n<p>geocode_result = gmaps.geocode(&#39;1600 Amphitheatre Parkway, Mountain View, CA&#39;)<\/p>\n<p>location = geocode_result[0][&#39;geometry&#39;][&#39;location&#39;]<\/p>\n<p>print((location[&#39;lat&#39;], location[&#39;lng&#39;]))<\/p>\n<h2><strong>\u53cd\u5411\u5730\u7406\u7f16\u7801<\/strong><\/h2>\n<p>reverse_geocode_result = gmaps.reverse_geocode((37.4219999, -122.0840575))<\/p>\n<p>address = reverse_geocode_result[0][&#39;formatted_address&#39;]<\/p>\n<p>print(address)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u4e09\u3001\u53ef\u89c6\u5316\u5730\u7406\u4fe1\u606f<\/h4>\n<\/p>\n<p><p>\u53ef\u89c6\u5316\u5730\u7406\u4fe1\u606f\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7406\u89e3\u548c\u5206\u6790\u5730\u7406\u6570\u636e\u3002Python\u63d0\u4f9b\u4e86\u591a\u4e2a\u5e93\u6765\u5b9e\u73b0\u5730\u7406\u4fe1\u606f\u7684\u53ef\u89c6\u5316\uff0c\u5982Folium\u3001Matplotlib\u548cPlotly\u7b49\u3002<\/p>\n<\/p>\n<p><p><strong>1. Folium\u7684\u4f7f\u7528<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>Folium\u662f\u4e00\u4e2a\u57fa\u4e8eLeaflet\u7684Python\u5e93\uff0c\u7528\u4e8e\u521b\u5efa\u4ea4\u4e92\u5f0f\u5730\u56fe\u3002\u5b83\u975e\u5e38\u9002\u5408\u7528\u4e8e\u53ef\u89c6\u5316\u5730\u7406\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import folium<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>m = folium.Map(location=[37.7749, -122.4194], zoom_start=13)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u8bb0<\/strong><\/h2>\n<p>folium.Marker([37.7749, -122.4194], popup=&#39;San Francisco&#39;).add_to(m)<\/p>\n<h2><strong>\u4fdd\u5b58\u5730\u56fe\u5230HTML\u6587\u4ef6<\/strong><\/h2>\n<p>m.save(&#39;map.html&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u4f7f\u7528Matplotlib\u8fdb\u884c\u5730\u7406\u53ef\u89c6\u5316<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>Matplotlib\u662f\u4e00\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684\u6570\u636e\u53ef\u89c6\u5316\u5e93\u3002\u7ed3\u5408Basemap\u6216Cartopy\uff0c\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u5730\u7406\u5730\u56fe\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>from mpl_toolkits.basemap import Basemap<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>m = Basemap(projection=&#39;mill&#39;, llcrnrlat=-60, urcrnrlat=90, llcrnrlon=-180, urcrnrlon=180)<\/p>\n<h2><strong>\u7ed8\u5236\u6d77\u5cb8\u7ebf\u548c\u56fd\u5bb6\u8fb9\u754c<\/strong><\/h2>\n<p>m.drawcoastlines()<\/p>\n<p>m.drawcountries()<\/p>\n<h2><strong>\u663e\u793a\u5730\u56fe<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u56db\u3001\u5b9e\u9645\u5e94\u7528\u6848\u4f8b<\/h4>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5730\u7406\u5750\u6807\u5b9a\u4f4d\u548c\u5730\u7406\u6570\u636e\u5904\u7406\u5e7f\u6cdb\u5e94\u7528\u4e8e\u591a\u4e2a\u9886\u57df\uff0c\u5982\u7269\u6d41\u3001\u4ea4\u901a\u3001\u73af\u5883\u76d1\u6d4b\u548c\u57ce\u5e02\u89c4\u5212\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5177\u4f53\u7684\u5e94\u7528\u6848\u4f8b\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u7269\u6d41\u9886\u57df<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>\u5728\u7269\u6d41\u9886\u57df\uff0c\u53ef\u4ee5\u4f7f\u7528\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u6765\u4f18\u5316\u914d\u9001\u8def\u7ebf\u548c\u63d0\u9ad8\u914d\u9001\u6548\u7387\u3002\u901a\u8fc7\u5206\u6790\u914d\u9001\u5730\u5740\u548c\u914d\u9001\u8def\u7ebf\uff0c\u53ef\u4ee5\u627e\u5230\u6700\u4f18\u7684\u914d\u9001\u8def\u5f84\uff0c\u4ece\u800c\u964d\u4f4e\u6210\u672c\u548c\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from geopy.distance import geodesic<\/p>\n<h2><strong>\u5b9a\u4e49\u914d\u9001\u70b9<\/strong><\/h2>\n<p>points = [(37.7749, -122.4194), (34.0522, -118.2437), (36.7783, -119.4179)]<\/p>\n<h2><strong>\u8ba1\u7b97\u914d\u9001\u70b9\u4e4b\u95f4\u7684\u8ddd\u79bb<\/strong><\/h2>\n<p>for i in range(len(points)):<\/p>\n<p>    for j in range(i + 1, len(points)):<\/p>\n<p>        distance = geodesic(points[i], points[j]).miles<\/p>\n<p>        print(f&quot;Distance between {points[i]} and {points[j]}: {distance:.2f} miles&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u73af\u5883\u76d1\u6d4b<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>\u5728\u73af\u5883\u76d1\u6d4b\u9886\u57df\uff0c\u53ef\u4ee5\u4f7f\u7528\u5730\u7406\u5750\u6807\u5b9a\u4f4d\u6765\u76d1\u6d4b\u6c61\u67d3\u6e90\u7684\u4f4d\u7f6e\u548c\u6c61\u67d3\u7269\u7684\u6269\u6563\u60c5\u51b5\u3002\u901a\u8fc7\u5206\u6790\u5730\u7406\u6570\u636e\uff0c\u53ef\u4ee5\u9884\u6d4b\u6c61\u67d3\u7269\u7684\u6269\u6563\u8def\u5f84\u548c\u5f71\u54cd\u8303\u56f4\uff0c\u4ece\u800c\u91c7\u53d6\u76f8\u5e94\u7684\u63aa\u65bd\u8fdb\u884c\u6cbb\u7406\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import geopandas as gpd<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6\u6c61\u67d3\u6e90\u6570\u636e<\/strong><\/h2>\n<p>pollution_sources = gpd.read_file(&quot;path\/to\/pollution_sources.shp&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>ax = pollution_sources.plot(figsize=(10, 10), color=&#39;red&#39;)<\/p>\n<h2><strong>\u663e\u793a\u5730\u56fe<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u4e94\u3001\u7ed3\u8bba<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u5b66\u4e60\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u5730\u7406\u5750\u6807\u8fdb\u884c\u5b9a\u4f4d\u3002\u6211\u4eec\u63a2\u8ba8\u4e86\u5730\u7406\u6570\u636e\u7684\u5904\u7406\u548c\u5206\u6790\u3001\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u3001\u4ee5\u53ca\u5730\u7406\u4fe1\u606f\u7684\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u5b9e\u9645\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u6211\u4eec\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528Geopandas\u3001Shapely\u3001Geopy\u3001Google Maps API\u3001Folium\u548cMatplotlib\u7b49\u5e93\u6765\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5730\u7406\u5750\u6807\u5b9a\u4f4d\u548c\u5730\u7406\u6570\u636e\u5904\u7406\u5e7f\u6cdb\u5e94\u7528\u4e8e\u591a\u4e2a\u9886\u57df\uff0c\u5982\u7269\u6d41\u3001\u4ea4\u901a\u3001\u73af\u5883\u76d1\u6d4b\u548c\u57ce\u5e02\u89c4\u5212\u7b49\u3002\u5e0c\u671b\u901a\u8fc7\u672c\u6587\u7684\u5b66\u4e60\uff0c\u80fd\u591f\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u5730\u7406\u5750\u6807\u5b9a\u4f4d\u6280\u672f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u5730\u7406\u5750\u6807\u8fdb\u884c\u4f4d\u7f6e\u5b9a\u4f4d\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\u6765\u8fdb\u884c\u5730\u7406\u5750\u6807\u5b9a\u4f4d\uff0c\u6700\u5e38\u7528\u7684\u662fGeopy\u548cFolium\u3002Geopy\u53ef\u4ee5\u5e2e\u52a9\u60a8\u901a\u8fc7\u7ecf\u7eac\u5ea6\u83b7\u53d6\u5177\u4f53\u5730\u5740\uff0c\u800cFolium\u5219\u53ef\u4ee5\u7528\u6765\u5728\u5730\u56fe\u4e0a\u53ef\u89c6\u5316\u8fd9\u4e9b\u4f4d\u7f6e\u3002\u4f7f\u7528Geopy\uff0c\u60a8\u53ea\u9700\u8f93\u5165\u7ecf\u7eac\u5ea6\u5373\u53ef\u83b7\u53d6\u8be6\u7ec6\u7684\u5730\u5740\u4fe1\u606f\uff0c\u975e\u5e38\u9002\u5408\u5730\u7406\u6570\u636e\u5206\u6790\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u83b7\u53d6\u5730\u7406\u5750\u6807\u7684\u6700\u4f73\u5e93\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u591a\u4e2a\u5e93\u53ef\u4ee5\u5b9e\u73b0\u5730\u7406\u5750\u6807\u7684\u83b7\u53d6\u548c\u5b9a\u4f4d\u3002\u5e38\u7528\u7684\u5305\u62ecGeopy\u3001Geocoder\u548cPandas\u3002Geopy\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5730\u7406\u7f16\u7801\u529f\u80fd\uff0c\u800cGeocoder\u5219\u652f\u6301\u591a\u79cd\u5730\u7406\u7f16\u7801API\u3002Pandas\u5728\u5904\u7406\u5305\u542b\u5730\u7406\u6570\u636e\u7684DataFrame\u65f6\u4e5f\u975e\u5e38\u6709\u7528\uff0c\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5e93\u7ed3\u5408\u4f7f\u7528\uff0c\u4fbf\u4e8e\u8fdb\u884c\u6279\u91cf\u5730\u7406\u7f16\u7801\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u5730\u7406\u5750\u6807\u53ef\u89c6\u5316\uff1f<\/strong><br \/>\u53ef\u89c6\u5316\u5730\u7406\u5750\u6807\u53ef\u4ee5\u4f7f\u7528Folium\u3001Matplotlib\u548cPlotly\u7b49\u5e93\u3002Folium\u7279\u522b\u9002\u5408\u7528\u4e8e\u521b\u5efa\u4ea4\u4e92\u5f0f\u5730\u56fe\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u5730\u56fe\u4e0a\u6807\u8bb0\u5730\u7406\u5750\u6807\u3002Matplotlib\u548cPlotly\u5219\u53ef\u4ee5\u901a\u8fc7\u6563\u70b9\u56fe\u7b49\u65b9\u5f0f\u5c55\u793a\u5750\u6807\u6570\u636e\uff0c\u9002\u5408\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u5c55\u793a\u3002\u901a\u8fc7\u8fd9\u4e9b\u5de5\u5177\uff0c\u60a8\u53ef\u4ee5\u76f4\u89c2\u5730\u770b\u5230\u4e0d\u540c\u4f4d\u7f6e\u7684\u5206\u5e03\u60c5\u51b5\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u4e0d\u51c6\u786e\u7684\u5730\u7406\u5750\u6807\u6570\u636e\uff1f<\/strong><br \/>\u5728\u4f7f\u7528\u5730\u7406\u5750\u6807\u65f6\uff0c\u5904\u7406\u4e0d\u51c6\u786e\u7684\u6570\u636e\u975e\u5e38\u91cd\u8981\u3002\u53ef\u4ee5\u4f7f\u7528Geopy\u548cPandas\u7ed3\u5408\u7684\u65b9\u5f0f\uff0c\u901a\u8fc7\u8bbe\u7f6e\u8bef\u5dee\u8303\u56f4\u6216\u4f7f\u7528\u805a\u7c7b\u7b97\u6cd5\u6765\u4f18\u5316\u6570\u636e\u3002\u6b64\u5916\uff0c\u901a\u8fc7\u5bf9\u6bd4\u591a\u4e2a\u6e90\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u66f4\u51c6\u786e\u5730\u786e\u5b9a\u4f4d\u7f6e\uff0c\u51cf\u5c11\u8bef\u5dee\u5e26\u6765\u7684\u5f71\u54cd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5f00\u5934\u6bb5\u843d\uff1a \u5229\u7528Python\u7684\u5730\u7406\u5750\u6807\u5b9a\u4f4d\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5730\u7406\u6570\u636e\u7684\u5904\u7406\u548c\u5206\u6790\u3001\u5730\u7406\u7f16\u7801\u548c\u53cd\u5411\u5730\u7406\u7f16\u7801\u3001\u53ef\u89c6\u5316\u5730\u7406\u4fe1 [&hellip;]","protected":false},"author":3,"featured_media":1096331,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096321"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1096321"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096321\/revisions"}],"predecessor-version":[{"id":1096332,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096321\/revisions\/1096332"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1096331"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1096321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1096321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1096321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}