❶ 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綾誨瀷