我有一組缺少地理位置名稱和座標的數據集在同一時間。我想填補空白,以便我可以繼續對數據進行未來分析。數據集是從Twitter收集的,因此它不是一個創建的數據,但是這就是數據來了,我需要以某種方式填補空白,並繼續進行未來的分析。如何在數據集中填寫缺失的地理位置?
選項1:我可以使用的userLocation
和userTimezone
的找到coordinates
輸入:
userLocation, userTimezone, Coordinates,
India, Hawaii, {u'type': u'Point', u'coordinates': [73.8567, 18.5203]}
California, USA
, New Delhi,
Ft. Sam Houston,Mountain Time (US & Canada),{u'type': u'Point', u'coordinates': [86.99643, 23.68088]}
Kathmandu,Nepal, Kathmandu, {u'type': u'Point', u'coordinates': [85.3248024, 27.69765658]}
期望輸出
userLocation, userTimezone, Coordinates_one, Coordinates_two
India, Hawaii, 73.8567, 18.5203
California, USA, [fill this] [fill this]
[Fill this], New Delhi, [fill this] [fill this]
Ft. Sam Houston,Mountain Time (US & Canada), 86.99643, 23.68088
Kathmandu, Kathmandu, 85.3248024, 27.69765658
是否可以寫一個腳本Python或熊貓在正確格式化輸出的同時填寫缺失的位置名稱和座標?
我知道Python或Pandas沒有任何魔術包,但是一開始就會有幫助。
我在GIS區問了這個問題,但在那裏沒有太多的幫助。這是我第一次使用地理位置數據集,我不知道如何開始。如果問題不適合,請評論刪除它而不是投票。
我認爲你必須檢查[pandas fillna()](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.fillna.html) 而[使用缺失數據](http://pandas.pydata.org/pandas-docs/stable/missing_data.html) – Leo