SlideShare uma empresa Scribd logo
1 de 68
Baixar para ler offline
2020년, 만약 모든 과목 선생님들이 파이썬을 배운다면?
>>> DIVE INTO 파이써니스쿨 <<<
송석리(greatsong21@gmail.com)
[ 간단한 자기소개 ]
2005 ~ 2015 선린인터넷고등학교 교사
2016 ~ 현재 한성과학고등학교 교사
2
[ 2017년 10월 파이썬 세미나 ]
3
2020 파이써니스쿨 PyGo
* 본 발표내용에서 사용된 코드는 연산자, for, if, list로 제작되었습니다.
5
2020 파이써니스쿨 PyGo
* 본 발표내용은 실화를 바탕으로 한 Fiction임을 알려드립니다.
5
2020 파이써니스쿨 PyGo
#1교시 - 사회 시간
2020년 파이고의 1교시는 사회 시간입니다.
6
* 출처 : 통합사회 교과서(구정화 등), 천재교육
6
[ 공공데이터포털 data.go.kr ]
7
[ 데이터 살펴보기 ]
8
“봄과 가을은 정말 줄고 있을까?”
“기온이 가장 긴 기간동안 증가한 때는?”
“데이터를 기반으로 24절기를 다시 나눈다면?”
…
9
[ 데이터에 질문하기 ]
[ 연 평균기온 변화 그래프 ]
9
“지구온난화로 100년 전보다 지금이 더 더울까?”
“보통 가장 더운 시기는 언제쯤일까?”
“서울이 가장 더웠던 해는 언제였을까?”
…..
[ 다음 시간에는 ]
10
파이고의 2교시, 통계 시간입니다.
2020 파이써니스쿨 PyGo
#2교시 - 통계 시간
11
“지구온난화로 100년 전보다 지금이 더 더울까?”
“보통 가장 더운 시기는 언제쯤일까?”
“서울이 가장 더웠던 해는 언제였을까?”
…..
[ 서울의 기온 데이터 ]
11
11
[ 최고 기온 데이터 - 꺽은선 그래프 ]
1. 라이브러리 불러오기
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import csv
 
f = open('seoul.csv')
data = csv.reader(f)
next(data)
 
result = []
 
for row in data :
    if row[-1] != '' :
        result.append(float(row[-1]))
        
plt.plot(result)
plt.show()
2. csv 데이터 읽어오기
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import csv
 
f = open('seoul.csv')
data = csv.reader(f)
next(data)
 
result = []
 
for row in data :
    if row[-1] != '' :
        result.append(float(row[-1]))
        
plt.plot(result)
plt.show()
3. 최고 기온 데이터 저장하기
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import csv
 
f = open('seoul.csv')
data = csv.reader(f)
next(data)
 
result = []
 
for row in data :
    if row[-1] != '' :
        result.append(float(row[-1]))
        
plt.plot(result)
plt.show()
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import csv
 
f = open('seoul.csv')
data = csv.reader(f)
next(data)
 
result = []
 
for row in data :
    if row[-1] != '' :
        result.append(float(row[-1]))
        
plt.plot(result)
plt.show()
4. 꺽은선 그래프로 그려주기
5. 다양한 형태의 그래프로 그려보기
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import csv
 
f = open('seoul.csv')
data = csv.reader(f)
next(data)
 
result = []
 
for row in data :
    if row[-1] != '' :
        result.append(float(row[-1]))
        
plt.hist(result, bins= 100)
plt.show()
[ 기온 데이터 - 히스토그램 ]
11
[ 계절별 기온 데이터(1월, 8월) - 히스토그램 ]
12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import matplotlib.pyplot as plt
import csv
f = open('seoul.csv')
data = csv.reader(f)
next(data)
jan = []
aug = []
 
for row in data :
    if row[-1] != '' and row[0].split('-')[1] == '01' :
        jan.append(float(row[-1]))
    if row[-1] != '' and row[0].split('-')[1] == '08' :
        aug.append(float(row[-1]))
 
plt.hist(jan, bins = 100)
plt.hist(aug, bins = 100)
plt.show()
[ 계절별 기온 데이터(1월, 8월) - 히스토그램 ]
12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import matplotlib.pyplot as plt
import csv
f = open('seoul.csv')
data = csv.reader(f)
next(data)
jan = []
aug = []
 
for row in data :
    if row[-1] != '' and row[0].split('-')[1] == '01' :
        jan.append(float(row[-1]))
    if row[-1] != '' and row[0].split('-')[1] == '08' :
        aug.append(float(row[-1]))
 
plt.hist(jan, bins = 100)
plt.hist(aug, bins = 100)
plt.show()
12
[ 계절별 기온 데이터(1월, 8월) - 히스토그램 ]
13
[ 계절별 기온 데이터(1월, 8월) - 수염 상자 그림 ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import matplotlib.pyplot as plt
import csv
f = open('seoul.csv')
data = csv.reader(f)
next(data)
jan = []
aug = []
for row in data :
if row[-1] != '' and row[0].split('-')[1] == '01' :
jan.append(float(row[-1]))
if row[-1] != '' and row[0].split('-')[1] == '08' :
aug.append(float(row[-1]))
plt.boxplot([jan, aug])
plt.xticks((1,2), ['Jan','Aug'])
plt.show()
13
[ 계절별 기온 데이터(1월, 8월) - 수염 상자 그림 ]
13
1
2
3
4
5
6
7
8
9
10
11
12
13
import matplotlib.pyplot as plt
import csv
f = open('seoul.csv')
data = csv.reader(f)
next(data)
month = [[],[],[],[],[],[],[],[],[],[],[],[]] #12개
 
for row in data :
    if row[-1] != '' :
        month[int(row[0].split('-')[1])-1].append(float(row[-1]))
        
plt.boxplot(month, showfliers=False)
plt.show()
Colored by Color Scripte
[ 월별 최고 기온 분포 - 수염 상자 그림 ]
13
[ 월별 최고 기온 분포 - 수염 상자 그림 ]
[ 8월의 최저 기온 분포 - 상자 그림 ]
14
"인구 통계의 변화는 미래와 관련된 것 가운데 정확한 예측을
할 수 있는 유일한 사실이라는 이유 때문에도 중요하다."
- 피터 드러커 15
[ 인구 데이터 - 행정안전부 ]
15
“우리 동네의 인구구조는 어떻게 생겼을까?”
“제주도는 정말 여성의 비율이 더 높을까?”
“우리 동네와 가장 인구구조가 비슷한 지역은 어딜까?”
…..
[ 호기심으로 시작하는 데이터 분석 ]
16
[ 인구구조 분석 프로젝트 - 우리동네 인구 구조 그려보기 ]
17
1
2
3
4
5
6
7
8
9
10
11
12
13
import matplotlib.pyplot as plt
import csv
f = open('age.csv', encoding = 'cp949')
data = csv.reader(f)
result = []
for row in data :
    if '신도림' in row[0] :
        for i in range(3,len(row)) : 
            result.append(int(row[i]))
            
plt.plot(result)
plt.show()
[ 인구구조 분석 프로젝트 - 우리동네 인구 구조 그려보기 ]
17
[ 인구구조 분석 프로젝트 - 우리동네 항아리 구조 그려보기 ]
17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import matplotlib.pyplot as plt
import csv
f = open('gender.csv', encoding = 'cp949')
data = csv.reader(f)
m_result = []
w_result = []
name = '신도림'
for row in data :
    if name in row[0] :
        for i in range(3,(len(row)-1)//2) : 
            m_result.append(-int(row[i]))
            w_result.append(int(row[i+(len(row)-1)//2]))
        break
plt.title(name + ' 지역의 성별 인구구조 그래프')
plt.barh(range(len(m_result)),m_result, color = 'hotpink', label = '남 ')
plt.barh(range(len(w_result)),w_result, color = 'indigo', label = '여 ')
plt.legend()
plt.show()
18
[ 인구구조 분석 프로젝트 - 우리동네 항아리 구조 그려보기 ]
[ 인구구조 분석 프로젝트 - 제주도는 여성 비율이 더 높을까? ]
19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import matplotlib.pyplot as plt
import csv
f = open('gender.csv', encoding = 'cp949')
data = csv.reader(f)
m = []
f = []
age = []
name = input('궁금한 동네를 입력해주세요 : ')
for row in data :
    if name in row[0] :
        for i in range(3,(len(row)-1)//2) : 
            m.append(int(row[i]))
            f.append(int(row[i+(len(row)-1)//2]))
            age.append(i-3)
        break
plt.title(name+' 지역의 성별 인구 그래프')
plt.scatter(m, f, c = age, alpha=0.5, cmap='jet')
plt.colorbar()
plt.plot(range(max(f)),range(max(f)), 'g')
plt.show()
19
[ 인구구조 분석 프로젝트 - 제주도는 여성 비율이 더 높을까? ]
[ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
20
20
import csv
import matplotlib.pyplot as plt
plt.rc('font', family = 'AppleGothic')
f = open('age.csv', encoding = 'cp949')
data = csv.reader(f)
next(data)
data = list(data)
pivot = []
name = input('어떤 지역의 인구구조가 궁금하신가요? : ')
for row in data :
if name in row[0] :
for i in range(3,len(row)) :
pivot.append(int(row[i])/int(row[2]))
break
[ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
20
mn = 1
for row in data :
s = 0
for i in range(3, len(row)) :
row[i] = int(row[i])/int(row[2])
tmp = (row[i] - pivot[i-3])
s = s + tmp
if s < mn and (name not in row[0]) :
result = []
for i in range(3, len(row)) :
result.append(row[i])
mn = s
result_name = row[0]
plt.plot(pivot, label = name)
plt.plot(result, label = result_name)
plt.legend()
plt.show()
[ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
21
[ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
21
[ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
22
[ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
[ 데이터 분석 팀 프로젝트 영상 ]
23
2020년 파이고의 3교시는 과학 시간입니다.
2020 파이써니스쿨 PyGo
#3교시 - 과학 시간
24
24
[ 3차원 공간에 직육면체 생성 ]
25
[ 속성(크기, 위치, 색깔 등) 설정하기 ]
26
[ 변화된 위치 = 현재 위치 + 속도 x 시간 ]
26
[ 속도의 방향 ]
27
[ 변화된 속도 = 현재 속도 + 가속도 x 시간 ]
27
[ 속도의 방향 ]
28
[ 과학 수행평가 공지 ]
28
2020년 파이고의 4교시는 영어 시간입니다.
2020 파이써니스쿨 PyGo
#4교시 - 영어 시간
29
[ 돌발 퀴즈 - 어린왕자의 저작권은? ]
30
[ 어린왕자 단어장 만들기 프로젝트 - step 1 ]
30
[ 어린왕자 단어장 만들기 프로젝트 - step 1 ]
{'Chapter': 27, 'one': 78, 'Once': 2, 'when': 30, 'I': 342, 'was': 155, 'six': 11,
'saw': 13, 'a': 384, 'magnificent': 3, 'picture': 3, 'in': 123, 'book': 4, 'about': 29,
'the': 741, 'jungle,': 1, 'called': 1, 'True': 1, 'Stories.': 1, 'It': 35, 'showed': 4,
'boa': 11, 'constrictor': 4, 'swallowing': 1, 'wild': 2, 'beast.': 1, 'Here': 2, 'is': 98,
'copy': 1, 'of': 259, 'picture.': 1, 'In': 5, 'it': 70, 'said:': 2, '"Boa': 1,
'constrictors': 2, 'swallow': 1, 'their': 12, 'prey': 1, 'whole,': 1, 'without': 12,
'chewing.': 1, 'Afterward': 1, 'they': 46, 'are': 74, 'no': 49, 'longer': 6, 'able': 5,
'to': 349, 'move,': 1, 'and': 188, 'sleep': 3, 'for': 99, 'months': 1, 'need': 10,
'digestion."': 1, 'those': 18, 'days': 5, 'thought': 8, 'lot': 3, 'jungle': 1,
'adventures,': 1, … }
30
[ 어린왕자 단어장 만들기 프로젝트 - step 2 ]
[('the', 829), ('i', 403), ('a', 396), ('to', 366), ('and', 333), ('of', 278), ('he', 255), ('you', 252),
('little', 232), ('prince', 171), ('that', 166), ('was', 161), ('said', 158), ('my', 143), ('but',
140), ('it', 136), ('for', 132), ('in', 130), ('me', 114), ('is', 107), ('on', 105), ('be', 102), ('his',
97), ('one', 96), ('have', 90), ('at', 85), ('all', 85), ('its', 83), ('are', 82), ('what', 77), ('if', 75),
('so', 74), ('as', 71), ('they', 69), ('then', 69), ('had', 69), ('no', 65), ('this', 65), ('planet', 65),
('him', 64), ('very', 61), ('not', 59), ('with', 58), ('like', 58), ('them', 57), ('im', 57), ('when',
53), ('from', 49), ('do', 49), ('flower', 49), ('by', 48), ('there', 45), ('good', 45), ('your', 43),
('never', 42), ('an', 41), ('who', 41), ('stars', 40), ('out', 40), ('too', 39), ('time', 38),
('would', 38), ('know', 38), ('sheep', 38), ('up', 37), ('where', 37), ('can', 36), ('just', 36),
('fox', 35), ('again', 33), ('dont', 33), ('about', 32), ('asked', 32), ('she', 32), ('only', 31),
('youre', 31), ('more', 30), ('here', 29), ('made', 29), ('king', 29), ('or', 28), ('nothing', 28),
('were', 28), ('chapter', 27), ('answered', 27), ('which', 27), ('thats', 27), ('how', 27),
('come', 27), ('course', 26), ('will', 25), ('ill', 25), ('now', 25), ('her', 25), ('been', 24),
('people', 24), ('man', 24), ('way', 24), ('youll', 24), ('make', 23)]

30
[ 어린왕자 단어장 만들기 프로젝트 - step 3 ]
31
[ 어린왕자 단어장 만들기 프로젝트 - step 3 ]
31
[ 어린왕자 단어장 만들기 프로젝트 - step 4 ]
32
pip install wordcloud
32
[ 어린왕자 단어장 만들기 프로젝트 - step 4 ]
2020년 파이고등학교 이야기, 어떠셨나요?
33
The future is already here — it's just not very evenly distributed.
- William Ford Gibson
33
Python can't change the world.
Python community can change the world.
34
Python can't change the world.
Python community can change the world.
34
송석리(greatsong21@gmail.com)
https://github.com/greatsong/pycon2018
감사합니다 :)
35

Mais conteúdo relacionado

Destaque

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Destaque (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

[2018 PyConKR] Dive Into 파이써니스쿨 - 2020년, 만약 모든 과목 선생님들이 파이썬을 배운다면?

  • 1. 2020년, 만약 모든 과목 선생님들이 파이썬을 배운다면? >>> DIVE INTO 파이써니스쿨 <<< 송석리(greatsong21@gmail.com)
  • 2. [ 간단한 자기소개 ] 2005 ~ 2015 선린인터넷고등학교 교사 2016 ~ 현재 한성과학고등학교 교사 2
  • 3. [ 2017년 10월 파이썬 세미나 ] 3
  • 4. 2020 파이써니스쿨 PyGo * 본 발표내용에서 사용된 코드는 연산자, for, if, list로 제작되었습니다. 5
  • 5. 2020 파이써니스쿨 PyGo * 본 발표내용은 실화를 바탕으로 한 Fiction임을 알려드립니다. 5
  • 6. 2020 파이써니스쿨 PyGo #1교시 - 사회 시간 2020년 파이고의 1교시는 사회 시간입니다. 6
  • 7. * 출처 : 통합사회 교과서(구정화 등), 천재교육 6
  • 10. “봄과 가을은 정말 줄고 있을까?” “기온이 가장 긴 기간동안 증가한 때는?” “데이터를 기반으로 24절기를 다시 나눈다면?” … 9 [ 데이터에 질문하기 ]
  • 11. [ 연 평균기온 변화 그래프 ] 9
  • 12. “지구온난화로 100년 전보다 지금이 더 더울까?” “보통 가장 더운 시기는 언제쯤일까?” “서울이 가장 더웠던 해는 언제였을까?” ….. [ 다음 시간에는 ] 10
  • 13. 파이고의 2교시, 통계 시간입니다. 2020 파이써니스쿨 PyGo #2교시 - 통계 시간 11
  • 14. “지구온난화로 100년 전보다 지금이 더 더울까?” “보통 가장 더운 시기는 언제쯤일까?” “서울이 가장 더웠던 해는 언제였을까?” ….. [ 서울의 기온 데이터 ] 11
  • 15. 11 [ 최고 기온 데이터 - 꺽은선 그래프 ]
  • 17. 2. csv 데이터 읽어오기 11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import matplotlib.pyplot as plt import csv   f = open('seoul.csv') data = csv.reader(f) next(data)   result = []   for row in data :     if row[-1] != '' :         result.append(float(row[-1]))          plt.plot(result) plt.show()
  • 18. 3. 최고 기온 데이터 저장하기 11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import matplotlib.pyplot as plt import csv   f = open('seoul.csv') data = csv.reader(f) next(data)   result = []   for row in data :     if row[-1] != '' :         result.append(float(row[-1]))          plt.plot(result) plt.show()
  • 20. 5. 다양한 형태의 그래프로 그려보기 11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import matplotlib.pyplot as plt import csv   f = open('seoul.csv') data = csv.reader(f) next(data)   result = []   for row in data :     if row[-1] != '' :         result.append(float(row[-1]))          plt.hist(result, bins= 100) plt.show()
  • 21. [ 기온 데이터 - 히스토그램 ] 11
  • 22. [ 계절별 기온 데이터(1월, 8월) - 히스토그램 ] 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import matplotlib.pyplot as plt import csv f = open('seoul.csv') data = csv.reader(f) next(data) jan = [] aug = []   for row in data :     if row[-1] != '' and row[0].split('-')[1] == '01' :         jan.append(float(row[-1]))     if row[-1] != '' and row[0].split('-')[1] == '08' :         aug.append(float(row[-1]))   plt.hist(jan, bins = 100) plt.hist(aug, bins = 100) plt.show()
  • 23. [ 계절별 기온 데이터(1월, 8월) - 히스토그램 ] 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import matplotlib.pyplot as plt import csv f = open('seoul.csv') data = csv.reader(f) next(data) jan = [] aug = []   for row in data :     if row[-1] != '' and row[0].split('-')[1] == '01' :         jan.append(float(row[-1]))     if row[-1] != '' and row[0].split('-')[1] == '08' :         aug.append(float(row[-1]))   plt.hist(jan, bins = 100) plt.hist(aug, bins = 100) plt.show()
  • 24. 12 [ 계절별 기온 데이터(1월, 8월) - 히스토그램 ]
  • 25. 13 [ 계절별 기온 데이터(1월, 8월) - 수염 상자 그림 ] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import matplotlib.pyplot as plt import csv f = open('seoul.csv') data = csv.reader(f) next(data) jan = [] aug = [] for row in data : if row[-1] != '' and row[0].split('-')[1] == '01' : jan.append(float(row[-1])) if row[-1] != '' and row[0].split('-')[1] == '08' : aug.append(float(row[-1])) plt.boxplot([jan, aug]) plt.xticks((1,2), ['Jan','Aug']) plt.show()
  • 26. 13 [ 계절별 기온 데이터(1월, 8월) - 수염 상자 그림 ]
  • 28. 13 [ 월별 최고 기온 분포 - 수염 상자 그림 ]
  • 29. [ 8월의 최저 기온 분포 - 상자 그림 ] 14
  • 30. "인구 통계의 변화는 미래와 관련된 것 가운데 정확한 예측을 할 수 있는 유일한 사실이라는 이유 때문에도 중요하다." - 피터 드러커 15
  • 31. [ 인구 데이터 - 행정안전부 ] 15
  • 32. “우리 동네의 인구구조는 어떻게 생겼을까?” “제주도는 정말 여성의 비율이 더 높을까?” “우리 동네와 가장 인구구조가 비슷한 지역은 어딜까?” ….. [ 호기심으로 시작하는 데이터 분석 ] 16
  • 33. [ 인구구조 분석 프로젝트 - 우리동네 인구 구조 그려보기 ] 17 1 2 3 4 5 6 7 8 9 10 11 12 13 import matplotlib.pyplot as plt import csv f = open('age.csv', encoding = 'cp949') data = csv.reader(f) result = [] for row in data :     if '신도림' in row[0] :         for i in range(3,len(row)) :              result.append(int(row[i]))              plt.plot(result) plt.show()
  • 34. [ 인구구조 분석 프로젝트 - 우리동네 인구 구조 그려보기 ] 17
  • 35. [ 인구구조 분석 프로젝트 - 우리동네 항아리 구조 그려보기 ] 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 import matplotlib.pyplot as plt import csv f = open('gender.csv', encoding = 'cp949') data = csv.reader(f) m_result = [] w_result = [] name = '신도림' for row in data :     if name in row[0] :         for i in range(3,(len(row)-1)//2) :              m_result.append(-int(row[i]))             w_result.append(int(row[i+(len(row)-1)//2]))         break plt.title(name + ' 지역의 성별 인구구조 그래프') plt.barh(range(len(m_result)),m_result, color = 'hotpink', label = '남 ') plt.barh(range(len(w_result)),w_result, color = 'indigo', label = '여 ') plt.legend() plt.show()
  • 36. 18 [ 인구구조 분석 프로젝트 - 우리동네 항아리 구조 그려보기 ]
  • 37. [ 인구구조 분석 프로젝트 - 제주도는 여성 비율이 더 높을까? ] 19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import matplotlib.pyplot as plt import csv f = open('gender.csv', encoding = 'cp949') data = csv.reader(f) m = [] f = [] age = [] name = input('궁금한 동네를 입력해주세요 : ') for row in data :     if name in row[0] :         for i in range(3,(len(row)-1)//2) :              m.append(int(row[i]))             f.append(int(row[i+(len(row)-1)//2]))             age.append(i-3)         break plt.title(name+' 지역의 성별 인구 그래프') plt.scatter(m, f, c = age, alpha=0.5, cmap='jet') plt.colorbar() plt.plot(range(max(f)),range(max(f)), 'g') plt.show()
  • 38. 19 [ 인구구조 분석 프로젝트 - 제주도는 여성 비율이 더 높을까? ]
  • 39. [ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ] 20
  • 40. 20 import csv import matplotlib.pyplot as plt plt.rc('font', family = 'AppleGothic') f = open('age.csv', encoding = 'cp949') data = csv.reader(f) next(data) data = list(data) pivot = [] name = input('어떤 지역의 인구구조가 궁금하신가요? : ') for row in data : if name in row[0] : for i in range(3,len(row)) : pivot.append(int(row[i])/int(row[2])) break [ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
  • 41. 20 mn = 1 for row in data : s = 0 for i in range(3, len(row)) : row[i] = int(row[i])/int(row[2]) tmp = (row[i] - pivot[i-3]) s = s + tmp if s < mn and (name not in row[0]) : result = [] for i in range(3, len(row)) : result.append(row[i]) mn = s result_name = row[0] plt.plot(pivot, label = name) plt.plot(result, label = result_name) plt.legend() plt.show() [ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
  • 42. 21 [ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
  • 43. 21 [ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
  • 44. 22 [ 인구구조 분석 프로젝트 - 우리 동네와 가장 비슷한 곳은? ]
  • 45. [ 데이터 분석 팀 프로젝트 영상 ] 23
  • 46. 2020년 파이고의 3교시는 과학 시간입니다. 2020 파이써니스쿨 PyGo #3교시 - 과학 시간 24
  • 47. 24
  • 48. [ 3차원 공간에 직육면체 생성 ] 25
  • 49. [ 속성(크기, 위치, 색깔 등) 설정하기 ] 26
  • 50. [ 변화된 위치 = 현재 위치 + 속도 x 시간 ] 26
  • 52. [ 변화된 속도 = 현재 속도 + 가속도 x 시간 ] 27
  • 54. [ 과학 수행평가 공지 ] 28
  • 55. 2020년 파이고의 4교시는 영어 시간입니다. 2020 파이써니스쿨 PyGo #4교시 - 영어 시간 29
  • 56. [ 돌발 퀴즈 - 어린왕자의 저작권은? ] 30
  • 57. [ 어린왕자 단어장 만들기 프로젝트 - step 1 ] 30
  • 58. [ 어린왕자 단어장 만들기 프로젝트 - step 1 ] {'Chapter': 27, 'one': 78, 'Once': 2, 'when': 30, 'I': 342, 'was': 155, 'six': 11, 'saw': 13, 'a': 384, 'magnificent': 3, 'picture': 3, 'in': 123, 'book': 4, 'about': 29, 'the': 741, 'jungle,': 1, 'called': 1, 'True': 1, 'Stories.': 1, 'It': 35, 'showed': 4, 'boa': 11, 'constrictor': 4, 'swallowing': 1, 'wild': 2, 'beast.': 1, 'Here': 2, 'is': 98, 'copy': 1, 'of': 259, 'picture.': 1, 'In': 5, 'it': 70, 'said:': 2, '"Boa': 1, 'constrictors': 2, 'swallow': 1, 'their': 12, 'prey': 1, 'whole,': 1, 'without': 12, 'chewing.': 1, 'Afterward': 1, 'they': 46, 'are': 74, 'no': 49, 'longer': 6, 'able': 5, 'to': 349, 'move,': 1, 'and': 188, 'sleep': 3, 'for': 99, 'months': 1, 'need': 10, 'digestion."': 1, 'those': 18, 'days': 5, 'thought': 8, 'lot': 3, 'jungle': 1, 'adventures,': 1, … } 30
  • 59. [ 어린왕자 단어장 만들기 프로젝트 - step 2 ] [('the', 829), ('i', 403), ('a', 396), ('to', 366), ('and', 333), ('of', 278), ('he', 255), ('you', 252), ('little', 232), ('prince', 171), ('that', 166), ('was', 161), ('said', 158), ('my', 143), ('but', 140), ('it', 136), ('for', 132), ('in', 130), ('me', 114), ('is', 107), ('on', 105), ('be', 102), ('his', 97), ('one', 96), ('have', 90), ('at', 85), ('all', 85), ('its', 83), ('are', 82), ('what', 77), ('if', 75), ('so', 74), ('as', 71), ('they', 69), ('then', 69), ('had', 69), ('no', 65), ('this', 65), ('planet', 65), ('him', 64), ('very', 61), ('not', 59), ('with', 58), ('like', 58), ('them', 57), ('im', 57), ('when', 53), ('from', 49), ('do', 49), ('flower', 49), ('by', 48), ('there', 45), ('good', 45), ('your', 43), ('never', 42), ('an', 41), ('who', 41), ('stars', 40), ('out', 40), ('too', 39), ('time', 38), ('would', 38), ('know', 38), ('sheep', 38), ('up', 37), ('where', 37), ('can', 36), ('just', 36), ('fox', 35), ('again', 33), ('dont', 33), ('about', 32), ('asked', 32), ('she', 32), ('only', 31), ('youre', 31), ('more', 30), ('here', 29), ('made', 29), ('king', 29), ('or', 28), ('nothing', 28), ('were', 28), ('chapter', 27), ('answered', 27), ('which', 27), ('thats', 27), ('how', 27), ('come', 27), ('course', 26), ('will', 25), ('ill', 25), ('now', 25), ('her', 25), ('been', 24), ('people', 24), ('man', 24), ('way', 24), ('youll', 24), ('make', 23)] 30
  • 60. [ 어린왕자 단어장 만들기 프로젝트 - step 3 ] 31
  • 61. [ 어린왕자 단어장 만들기 프로젝트 - step 3 ] 31
  • 62. [ 어린왕자 단어장 만들기 프로젝트 - step 4 ] 32
  • 63. pip install wordcloud 32 [ 어린왕자 단어장 만들기 프로젝트 - step 4 ]
  • 65. The future is already here — it's just not very evenly distributed. - William Ford Gibson 33
  • 66. Python can't change the world. Python community can change the world. 34
  • 67. Python can't change the world. Python community can change the world. 34