❶ Python涓镄凣eoPandas鍜孏eoDataFrame
GeoPandas鏄瀵筽andas镄勬墿灞曪纴鐢ㄤ簬澶勭悊鍦扮悊绌洪棿鏁版嵁
GeoDataFrame鏄鍏朵腑涓涓鏁版嵁绫诲瀷锛屽拰ArcGIS涓镄勫睘镐ц〃寰埚儚锛屾湁鍑犱綍褰㈢姸瀛楁碉纸绾㈡嗭级鍜屽父瑙勭殑灞炴у瓧娈碉纸缁挎嗭级锛屽氨钖岖О涓崭竴镙疯屽凡銆
鍓嶆彁锛歩mport geopandas as gpd
璇诲叆涔嫔悗锛宒f涓篏eoDataFrame镙煎纺锛岀粨鏋勫备笅锛
缁撴灉锛
geometry瀛楁典腑璁板綍镄勬槸鍑犱綍褰㈢姸锛岀被鍨嬫槸GeoSeries锛屾湁寰埚氩嚱鏁拌繘琛岀浉搴旀搷浣
涔嫔悗镄刣f瀹屽叏鍙浠ュ楃敤dataframe镄勬搷浣沧柟娉
锅囧傜幇鍦ㄧ殑df涓猴细
iloc 杈揿叆镄勬槸鏁板瓧绫诲瀷浣岖疆绱㈠紩
loc 杈揿叆镄勬槸鏂囨湰绫诲瀷镄勪綅缃绱㈠紩钖
at 鍜宭oc镄勭敤娉曞樊涓嶅
it 灏辨槸灞炴ц〃涓镄勪竴琛屻俶ath涓哄叾涓镄勪竴涓瀛楁靛悕
杈揿嚭锛
df[1]['math']=100 杩欑嶅彧瑕佹槸 鐢ㄤ袱涓𨰾鍙疯繘琛岀储寮曚慨鏀圭殑鍧囨棤鏁 锛岃繖绉岖储寮曟柟寮忓彲浠ョ悊瑙d负鍏堟嬁鍑轰简涓琛岋纸鏄涓瑙嗗浘锛夛纴淇鏀瑰疄闄呬笂骞舵湭瀵瑰师鏁版嵁淇鏀广
姝ゅ栵纴灏濊瘯鍒╃敤涓婅堪iloc阆嶅巻淇鏀逛篃涓嶈
浼氩嚭鐜伴敊璇锛
姝g‘锅氭硶鏄鍦ㄥ师df涓婂彇鍊硷纴涓涓𨰾鍙风洿鎺ュ畾浣嶃
阃氲繃iloc阆嶅巻淇鏀瑰彲鍐欐垚濡备笅鏂瑰纺锛
鍏抽敭璇鍙ワ细gp.name
姝e父浜虹殑镐濈淮閮戒细璁や负sort_values鎺掑簭涔嫔悗锛屾寜1,2,3钬︹﹀幓绱㈠紩鏁版嵁镄勬椂鍊椤氨鏄涓涓浠庢帓濂藉簭镄勬暟鎹锛屼絾鏄瀹为檯涓婂备笅锲炬墍绀猴纴sort_values钖庢暟鎹琛ㄧ‘瀹炴寜鏁板︽垚缁╂帓搴忎简锛屼絾鏄绱㈠紩骞舵湭鏀瑰彉锛岃繖鏄鎸夌収鎸1,2,3钬︹﹀幓绱㈠紩鍏跺疄杩樻槸铡熸潵镄勯‘搴忥纴鐪嬭捣𨱒ュソ镀忓苟链鎺掑簭锛屾墍浠ユ帓搴忓悗链濂界敤reset_index閲嶆柊寤虹珛绱㈠紩銆
浠ヤ笅灏唖tring绫诲瀷镄凬eighbors鏀逛负list绫诲瀷
浠ヤ笅灏唋ist绫诲瀷镄凬eighbors鏀逛负string绫诲瀷