Q&A
下記サイトを参考に地図上にプロットする方法を実装しているのですがエラーが出てきてできません
緯度・経度を指定してプロットする方法 その2(複数)
Python
1import folium 2import pandas as pd 3 4cities = pd.DataFrame({ 5 'train': ['駒込','日暮里', '池袋', '鶯谷'], 6 'latitude': [35.736489,35.727772, 35.728926, 35.720495], 7 'longtude': [139.746875,139.770987, 139.71038, 139.778837], 8}) 9 10map = folium.Map(location=[35.736489,139.746875], zoom_start=14) 11 12for i, r in cities.iterrows(): 13 folium.Marker(location=[r['latitude'], r['longtude']], popup=r['train']).add_to(map) 14 15map.save("map_train.html") 16
このコードを実行すると以下のエラー文が出てきてしまいます
pi@raspberrypi:~/Desktop $ sudo python3 03.py
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/pandas/init.py", line 26, in <module>
from pandas._libs import (hashtable as _hashtable,
File "/usr/local/lib/python3.5/dist-packages/pandas/_libs/init.py", line 4, in <module>
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
ImportError: cannot import name 'iNaT'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "03.py", line 2, in <module>
import pandas as pd
File "/usr/local/lib/python3.5/dist-packages/pandas/init.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: 'iNaT' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
何が原因でしょうか?
回答2件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
退会済みユーザー
2018/10/25 04:43