folium में मार्कर और पॉपअप बनाना

Python में Geospatial Data का Visualization

Mary Van Valkenburg

Data Science Program Manager, Nashville Software School

for row in schools_in_dist1.iterrows():
    row_values = row[1]
    print(row_values)
name                              Alex Green Elementary
lat                                              36.253
lng                                            -86.8322
geometry                 POINT (-86.8322292 36.2529607)
district                                              1
center      POINT (-86.86086595994405 36.2628221811899)
Name: 1, dtype: object
name                               Bellshire Elementary
lat                                             36.2697
lng                                            -86.7623
geometry               POINT (-86.76230026 36.26968766)
district                                              1
center      POINT (-86.86086595994405 36.2628221811899)
Name: 8, dtype: object
Python में Geospatial Data का Visualization

मार्कर लोकेशन बनाना

# Construct a folium map for school district 1
district1_map = folium.Map(location = district_center, zoom_start = 11)

#create a marker for each school
for row in schools_in_dist1.iterrows():
    row_values = row[1]
    location = [row_values['lat'], row_values['lng']]
    marker = folium.Marker(location = location)
    marker.add_to(district1_map)

    display(district1_map)
Python में Geospatial Data का Visualization

मार्कर लोकेशन बनाना

folium मार्करों के साथ नैशविल का स्ट्रीट मैप

Python में Geospatial Data का Visualization

DataFrame के डेटा से पॉपअप बनाना

# Construct a folium map for school district 1
district1_map = folium.Map(location = district_center, zoom_start = 11)

# Create a marker for each school
for row in schools_in_dist1.iterrows():
    row_values = row[1]
    location = [row_values['lat'], row_values['lng']]
    popup = popup = '<strong>' + row_values['name'] + '</strong>'
    marker = folium.Marker(location = location, popup = popup)
    marker.add_to(district1_map)

    display(district1_map)
Python में Geospatial Data का Visualization

DataFrame के डेटा से पॉपअप बनाना

मार्करों और "Whites Creek High School" पॉपअप वाला नैशविल का स्ट्रीट मैप

Python में Geospatial Data का Visualization

पॉपअप ट्रबलशूटिंग

मार्करों और "NaN" पॉपअप वाला नैशविल का स्ट्रीट मैप

Python में Geospatial Data का Visualization

अभ्यास करते हैं!

Python में Geospatial Data का Visualization

Preparing Video For Download...