2017-12-03 26 views
0

これをどのように修正する必要がありますか?基本的には、地理情報に基づいてつぶやきの地図を作成したいと思います。私が収集したすべてのつぶやきは米国内にあり、地理情報もあります。AttributeError: 'Map'オブジェクトに 'circle_marker'属性がありません

Traceback (most recent call last): 
    File "tweet_map.py", line 19, in <module> 
    tweet_map.circle_marker(location=geo, radius=250) 
AttributeError: 'Map' object has no attribute 'circle_marker' 

ここでコードは次のとおりです。#Python IRCチャンネルからの助けに

#create a map of tweets using Folium 

import folium, pandas, ast 

# get geo data only from rows with non-empty values 
locations = pandas.read_csv('./usa_tweets.csv', usecols=[3]).dropna() 

geos = [] 

for location in locations.values: 
    # add to geos array an evaluated python literal syntax of the data 
    geos.append(ast.literal_eval(location[0])['coordinates']) 

# initialize and create map 
tweet_map = folium.Map(location=[52.8, -2], tiles='Mapbox Bright', zoom_start=7) 

# add markers 
for geo in geos: 
    tweet_map.circle_marker(location=geo, radius=250) 

tweet_map.create 

答えて

0

ありがとう:

for geo in geos: 
    #tweet_map.CircleMarker(location=geo, radius=250) 
    folium.CircleMarker(location=geo, radius=250).add_to(tweet_map) 
tweet_map.save('map.html') 
関連する問題