동대문구 고령자 사고가 가장 많이 일어났기 때문에 동대문구 안에서 노인보호구역을 지정
import pandas as pd
import folium
df_acc = pd.read_csv('../data/보행고령자 사고다발/서울 고령자사고다발지역.csv')
df_d = df_acc[df_acc['구']=='동대문구']
df_d.to_csv('../data/보행고령자 사고다발/동대문구 사고다발지역.csv')
df_d.drop('Unnamed: 0',axis=1,inplace=True)
df_d.sort_values('발생건수',inplace=True,ascending=False)
df_d.reset_index(inplace=True)
df_d.drop('index',axis=1,inplace=True)
center = [37.579 , 127.045]
mapdata = folium.Map(location=center, zoom_start = 14)
for temp in df_d.index:
folium.Circle(
[df_d['위도'][temp], df_d['경도'][temp]],
radius = int(df_d.loc[temp, ['발생건수']].values[0] * 8), color='red', fill_color='red'
).add_to(mapdata)
mapdata
center = [37.579 , 127.045]
mapdata = folium.Map(location=center, zoom_start = 15)
for temp in df_d.index:
folium.Circle(
[df_d['위도'][temp], df_d['경도'][temp]],
radius = 8, color='red', fill='crimson'
).add_to(mapdata)
mapdata
all_a = pd.read_csv('../data/보행고령자 사고다발/동대문구 4개 비교.csv')
all_a = all_a.set_index('구역')
center = [37.57841294, 127.0377316]
mapdata = folium.Map(location=center, zoom_start = 16.3)
folium.Circle(
[37.57841294, 127.0377316],
radius = 150,color='red', fill_color='red'
).add_to(mapdata)
for temp in df_d.index:
folium.Circle(
[df_d['위도'][temp], df_d['경도'][temp]],
radius = int(df_d.loc[temp, ['발생건수']].values[0] /2), color='red', fill_color='red'
).add_to(mapdata)
mapdata
center = [37.57949654, 127.0416463]
mapdata = folium.Map(location=center, zoom_start = 16.3)
folium.Circle(
[37.57949654, 127.0416463],
radius = 150,color='red', fill_color='red'
).add_to(mapdata)
for temp in df_d.index:
folium.Circle(
[df_d['위도'][temp], df_d['경도'][temp]],
radius = int(df_d.loc[temp, ['발생건수']].values[0] /2), color='red', fill_color='red'
).add_to(mapdata)
mapdata
center = [37.58089546, 127.0455197]
mapdata = folium.Map(location=center, zoom_start = 16.3)
folium.Circle(
[37.58089546, 127.0455197],
radius = 150,color='red', fill_color='red'
).add_to(mapdata)
for temp in df_d.index:
folium.Circle(
[df_d['위도'][temp], df_d['경도'][temp]],
radius = int(df_d.loc[temp, ['발생건수']].values[0] /2), color='red', fill_color='red'
).add_to(mapdata)
mapdata
center = [37.58993298, 127.0553216]
mapdata = folium.Map(location=center, zoom_start = 16.3)
folium.Circle(
[37.58993298, 127.0553216],
radius = 150,color='red', fill_color='red'
).add_to(mapdata)
for temp in df_d.index:
folium.Circle(
[df_d['위도'][temp], df_d['경도'][temp]],
radius = int(df_d.loc[temp, ['발생건수']].values[0] /2), color='red', fill_color='red'
).add_to(mapdata)
mapdata