-
[Environment Data Analysis] - 세계 어업 생산량 데이터 분석 with Python, PlotlyData Analysis/Environment 2021. 6. 14. 23:34
최근에 넷플릭스에서 본 환경 다큐멘터리 "Seaspiracy"를 보고 굉장히 충격을 받았다. 그동안 바다를 파괴시킨 주범은 빨대가 아니라 바로 무차별적인 상업적 어업이라는 사실을 처음 알게 되었기 때문이다. 상업적 어업 과정에서 버려진 그물 등 폐어구가 해양쓰레기의 절반가량을 차지하고, 지구를 12바퀴 정도 감을 수 있는 폐어망이 쓰레기로 바다에 버려져 있고, 이로 인해 상어, 고래, 바다거북이 등이 대규모로 죽고 있어 바다 생태계를 무너트리고 있다고 한다. 너무 공격적인 주장이기는 하지만 해당 다큐멘터리에서는 해양 생태계를 위해 해양생물을 더 이상 먹지 말자고 한다. 그래서 이번 포스팅에서 이러한 주장을 데이터로 한 번 확인해보도록 하겠다. 우리가 그동안 얼마나 해양 생물을 잡아먹었는지 보자. 데이터는 아래 링크에서 확인할 수 있다.
https://data.worldbank.org/indicator/ER.FSH.PROD.MT?year=1990
1. 1960년 ~ 2015년 세계 어업 생산량
1960년 대비 2015년 세계 어업 생산량이 약 2억 톤으로 무려 5배나 증가했다. 엄청난 증가 속도다...
import pandas as pd import plotly.express as px import plotly.graph_objects as go df=pd.read_csv('fisheries.csv') df=df.drop(['Indicator Code','Indicator Name'],axis=1) total=df.melt(id_vars=['Country Name','Country Code'],var_name='Year',value_name='Total Fisheries Production(ton)') world=total[total['Country Name']=='World'] world=world[~world['Total Fisheries Production(ton)'].isnull()] fig = px.line(world, x="Year", y="Total Fisheries Production(ton)", title='World Total Fisheries Production(ton)') fig.show()
그렇다면 한국 어업 생산량은 추이는 어떤지 확인해보겠다. 80년대 이후로는 생산량이 증가하고 있지는 않지만 2018년 생산량이 무려 300만 톤이다. 1960년 대비 10배 증가한 생산량이다.
korea=total[total['Country Name']=='Korea, Rep.'] korea=korea[~korea['Total Fisheries Production(ton)'].isnull()] fig = px.line(korea, x="Year", y="Total Fisheries Production(ton)", title='Korea Total Fisheries Production(ton)') fig.show()
2. 1960년 vs 2018년 어업 생산량이 가장 많이 증가한 국가 Top 10 With Korea
오세아니아의 섬나라 미크로네시아 연방, 중앙아메리카에 있는 벨리즈, 아프리카의 짐바브웨, 세이셸, 기니, 이란, 네팔, 르완다, 볼리비아, 아프칸니스탄 등 국가가 가장 증가폭이 높게 나타났다. 전반적으로 개발이 덜 된 국가들에서 생산량이 큰 폭으로 증가했다.
total_1960=total[total['Year']=='1960'] total_2018=total[total['Year']=='2018'] comp=pd.merge(left=total_1960,right=total_2018,how='inner',left_on=['Country Name'],right_on=['Country Name']) comp=comp[(comp['Total Fisheries Production(ton)_x'].notnull()) & (comp['Total Fisheries Production(ton)_x']!=0)] comp=comp[~comp['Country Name'].str.contains('Europe|Pacific')] comp['increase']=((comp['Total Fisheries Production(ton)_y']/comp['Total Fisheries Production(ton)_x'])-1)*100 comp_10=comp.sort_values(by='increase',ascending=False).head(10) temp=comp[(comp['Country Name']=='Korea, Rep.')] change=pd.concat([comp_10,temp],axis=0) colors = ['lightslategray',] * len(change) colors[change['Country Name'].values.tolist().index('Korea, Rep.')] = 'crimson' fig = go.Figure(data=[go.Bar( x=change['Country Name'], y=change['increase'], marker_color=colors, text=change['increase'] )]) fig.update_traces(texttemplate='%{text:.2f}%',textposition='outside',) fig.update_layout(title_text='') fig.show()
3. 2018년 가장 많은 어업 생산량을 보인 국가 Top 10
가장 최근 데이터라고 볼 수 있는 2018년 기준으로 가장 많은 생산량을 보인 국가 Top 10을 한번 확인해보도록 하겠다.
역시 넘사벽 중국이다. 18년에 무려 8천 만 톤이 중국에서 잡혔다. 나머지 9개 국가 생산량을 다 합쳐야 중국 한 국가에서 나오는 생산량과 비슷할 것 같다. 13억 인구의 위엄인 듯싶다.
total_2018=total_2018.sort_values(by='Total Fisheries Production(ton)',ascending=False) total_2018_=total_2018[~total_2018['Country Name'].str.contains('''South Asia|North America|Euro area|Arab World|total|Europe|Middle East|Heavily|income|Pacific|only|Fragile and conflict affected situations|dividend|OECD|IDA|Latin|developed|Sub-Saharan''')].head(10) korea_2018=total_2018[total_2018['Country Name']=='Korea, Rep.'] total_rank=pd.concat([total_2018_,korea_2018],axis=0) colors = ['lightslategray',] * len(total_rank) colors[total_rank['Country Name'].values.tolist().index('Korea, Rep.')] = 'crimson' fig = go.Figure(data=[go.Bar( x=total_rank['Country Name'], y=total_rank['Total Fisheries Production(ton)'], marker_color=colors, text=total_rank['Total Fisheries Production(ton)'] )]) fig.update_traces(texttemplate='%{text}',textposition='outside',) fig.update_layout(title_text='2018 Total Fisheries Production(ton) Top 10 country') fig.show()
위 그래프에서 눈에 띄는 점이 있는데 바로 한중일의 위엄이다. 세계 그 어느 민족보다 생선을 좋아하는 민족으로 18년에만 봐도 엄청난 어획량을 보이고 있다. 그래서 전 세계 어획량에서 한중일이 차지하는 비중을 한번 그래프로 그려보도록 하겠다.
20% 중후반이었던 비중이 21세기 들어서 무려 40% 이상을 기록하고 있다. 한중일 국가 사람들이 전 세계 어획 생산량의 절반을 잡고 있는 중이다. 역시나 한중일이 문제다.
kjc=total[(total['Country Name']=='China')|(total['Country Name']=='Japan')|(total['Country Name']=='Korea, Rep.')] sum_kjc=pd.DataFrame(kjc.groupby(['Year']).sum()['Total Fisheries Production(ton)']) sum_kjc=sum_kjc.reset_index() world_kjc=pd.merge(left=world,right=sum_kjc, how='inner',left_on=['Year'],right_on=['Year']) world_kjc['prop']=world_kjc['Total Fisheries Production(ton)_y']/world_kjc['Total Fisheries Production(ton)_x'] fig = px.line(world_kjc, x="Year", y="prop", title='percentage of fisheries produced from korea/Japan/China in the world') fig.show()
마지막으로 19년 국가별 생산량 기준으로 트리맵을 그려보도록 하겠다.
tm=total_2018[~total_2018['Country Name'].str.contains('''Other small states|South Asia|Small states|North America|Euro area|Arab World|total|Europe|Middle East|Heavily|income|Pacific|only|Fragile and conflict affected situations|dividend|OECD|IDA|Latin|developed|Sub-Saharan''')] tm=tm[tm['Total Fisheries Production(ton)'].notnull()] fig = px.treemap(tm, path=['Country Name'], values='Total Fisheries Production(ton)', color='Country Name', title='Treemap of Fisheries Production(ton) per country') fig.show()
데이터로 확인한 결과 어업 생산량이 엄청난 속도로 증가하고 있는 중이다. 매년 몇 억 톤씩 해양 생물을 잡고 있으니 당연히 해양생태계가 파괴될 수 밖에 없다고 본다. 무작정 물고기를 먹지 말자고는 할 수 없지만 환경을 위해서 해물을 먹기 전에 한번 고민을 해볼 필요는 있다고 생각하고, 시간이 나면 넷플릭스에 있는 씨스피러시라는 다큐멘터리 꼭 보시기를 바란다.
'Data Analysis > Environment' 카테고리의 다른 글