import json
import folium
import pandas


df=pandas.read_csv("Volcanoes-USA.txt")

map=folium.Map(location=[df['LAT'].mean(),df['LON'].mean()],zoom_start=6,tiles='Stamen Terrain')

def color(elev):
    minimum=int(min(df['ELEV']))
    step=int((max(df['ELEV'])-min(df['ELEV']))/3)
    if elev in range(minimum,minimum+step):
        col='green'
    elif elev in range(minimum+step,minimum+step*2):
        col='orange'
    else:
        col='red'
    return col

tooltip = 'Click me!'

fg=folium.FeatureGroup(name="Volcano Locations")


for lat,lon,name,elev in zip(df['LAT'],df['LON'],df['NAME'],df['ELEV']):
    fg.add_child(folium.Marker(location=[lat,lon],popup=name,icon=folium.Icon(color(elev),icon_color='green'))).add_to(map)

map.add_child(fg)

map.add_child(folium.GeoJson(data=open('World_Population.json', 'r', encoding='utf-8-sig').read(), style_function=lambda x: {'fillColor':'green' if x['properties']['POP2005'] < 10000000 else 'orange' if 10000000 <= x['properties']['POP2005'] < 20000000 else 'red'}))

map.add_child(folium.LayerControl())

map.save(outfile='mthood.html')

4b031508a075ed62251fb2e58a2b4da656b7dfc0
<mask token>


def color(elev):
    minimum = int(min(df['ELEV']))
    step = int((max(df['ELEV']) - min(df['ELEV'])) / 3)
    if elev in range(minimum, minimum + step):
        col = 'green'
    elif elev in range(minimum + step, minimum + step * 2):
        col = 'orange'
    else:
        col = 'red'
    return col


<mask token>

<mask token>


def color(elev):
    minimum = int(min(df['ELEV']))
    step = int((max(df['ELEV']) - min(df['ELEV'])) / 3)
    if elev in range(minimum, minimum + step):
        col = 'green'
    elif elev in range(minimum + step, minimum + step * 2):
        col = 'orange'
    else:
        col = 'red'
    return col


<mask token>
for lat, lon, name, elev in zip(df['LAT'], df['LON'], df['NAME'], df['ELEV']):
    fg.add_child(folium.Marker(location=[lat, lon], popup=name, icon=folium
        .Icon(color(elev), icon_color='green'))).add_to(map)
map.add_child(fg)
map.add_child(folium.GeoJson(data=open('World_Population.json', 'r',
    encoding='utf-8-sig').read(), style_function=lambda x: {'fillColor': 
    'green' if x['properties']['POP2005'] < 10000000 else 'orange' if 
    10000000 <= x['properties']['POP2005'] < 20000000 else 'red'}))
map.add_child(folium.LayerControl())
map.save(outfile='mthood.html')

<mask token>
df = pandas.read_csv('Volcanoes-USA.txt')
map = folium.Map(location=[df['LAT'].mean(), df['LON'].mean()], zoom_start=
    6, tiles='Stamen Terrain')


def color(elev):
    minimum = int(min(df['ELEV']))
    step = int((max(df['ELEV']) - min(df['ELEV'])) / 3)
    if elev in range(minimum, minimum + step):
        col = 'green'
    elif elev in range(minimum + step, minimum + step * 2):
        col = 'orange'
    else:
        col = 'red'
    return col


tooltip = 'Click me!'
fg = folium.FeatureGroup(name='Volcano Locations')
for lat, lon, name, elev in zip(df['LAT'], df['LON'], df['NAME'], df['ELEV']):
    fg.add_child(folium.Marker(location=[lat, lon], popup=name, icon=folium
        .Icon(color(elev), icon_color='green'))).add_to(map)
map.add_child(fg)
map.add_child(folium.GeoJson(data=open('World_Population.json', 'r',
    encoding='utf-8-sig').read(), style_function=lambda x: {'fillColor': 
    'green' if x['properties']['POP2005'] < 10000000 else 'orange' if 
    10000000 <= x['properties']['POP2005'] < 20000000 else 'red'}))
map.add_child(folium.LayerControl())
map.save(outfile='mthood.html')

import json
import folium
import pandas
df = pandas.read_csv('Volcanoes-USA.txt')
map = folium.Map(location=[df['LAT'].mean(), df['LON'].mean()], zoom_start=
    6, tiles='Stamen Terrain')


def color(elev):
    minimum = int(min(df['ELEV']))
    step = int((max(df['ELEV']) - min(df['ELEV'])) / 3)
    if elev in range(minimum, minimum + step):
        col = 'green'
    elif elev in range(minimum + step, minimum + step * 2):
        col = 'orange'
    else:
        col = 'red'
    return col


tooltip = 'Click me!'
fg = folium.FeatureGroup(name='Volcano Locations')
for lat, lon, name, elev in zip(df['LAT'], df['LON'], df['NAME'], df['ELEV']):
    fg.add_child(folium.Marker(location=[lat, lon], popup=name, icon=folium
        .Icon(color(elev), icon_color='green'))).add_to(map)
map.add_child(fg)
map.add_child(folium.GeoJson(data=open('World_Population.json', 'r',
    encoding='utf-8-sig').read(), style_function=lambda x: {'fillColor': 
    'green' if x['properties']['POP2005'] < 10000000 else 'orange' if 
    10000000 <= x['properties']['POP2005'] < 20000000 else 'red'}))
map.add_child(folium.LayerControl())
map.save(outfile='mthood.html')

import json
import folium
import pandas


df=pandas.read_csv("Volcanoes-USA.txt")

map=folium.Map(location=[df['LAT'].mean(),df['LON'].mean()],zoom_start=6,tiles='Stamen Terrain')

def color(elev):
    minimum=int(min(df['ELEV']))
    step=int((max(df['ELEV'])-min(df['ELEV']))/3)
    if elev in range(minimum,minimum+step):
        col='green'
    elif elev in range(minimum+step,minimum+step*2):
        col='orange'
    else:
        col='red'
    return col

tooltip = 'Click me!'

fg=folium.FeatureGroup(name="Volcano Locations")


for lat,lon,name,elev in zip(df['LAT'],df['LON'],df['NAME'],df['ELEV']):
    fg.add_child(folium.Marker(location=[lat,lon],popup=name,icon=folium.Icon(color(elev),icon_color='green'))).add_to(map)

map.add_child(fg)

map.add_child(folium.GeoJson(data=open('World_Population.json', 'r', encoding='utf-8-sig').read(), style_function=lambda x: {'fillColor':'green' if x['properties']['POP2005'] < 10000000 else 'orange' if 10000000 <= x['properties']['POP2005'] < 20000000 else 'red'}))

map.add_child(folium.LayerControl())

map.save(outfile='mthood.html')
