PowerPoint 프레젠테이션

Similar documents
데이터 시각화

기술통계

PowerPoint 프레젠테이션

확률 및 분포

Polly_with_Serverless_HOL_hyouk

PART

Part Part

½ºÅ丮ÅÚ¸µ3_³»Áö

272*406OSAKAÃÖÁ¾-¼öÁ¤b64ٽÚ

£01¦4Àå-2

신림프로그래머_클린코드.key

Web Scraper in 30 Minutes 강철

Microsoft PowerPoint - Java7.pptx

#한국사문제7회4급

문서의 제목 나눔고딕B, 54pt

Microsoft Word _mentor_conf_output5.docx

LCD Display

PowerPoint 프레젠테이션

01-OOPConcepts(2).PDF

No Slide Title

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

Microsoft PowerPoint - 04-UDP Programming.ppt

Modern Javascript

SIGPLwinterschool2012

PHP & ASP

Remote UI Guide

PowerPoint Presentation

Microsoft PowerPoint Python-Function.pptx

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

12-file.key

Week13

T100MD+

K&R2 Reference Manual 번역본

%eb%8f%99%ec%9d%b8-[NO_09]%20%ec%9d%98%ea%b3%bc%eb%8c%80%ed%95%99%20%ec%86%8c%ec%8b%9d%ec%a7%80_F(%ec%b5%9c%ec%a2%85)-2.pdf

8장 문자열

rmi_박준용_final.PDF

2015 경제ㆍ재정수첩

Secure Programming Lecture1 : Introduction

PowerPoint 프레젠테이션

untitled

14-Servlet


NLTK 6: 텍스트 분류 학습 (` `%%%`#`&12_`__~~~ౡ氀猀攀)

Microsoft PowerPoint - web-part03-ch19-node.js기본.pptx

Java

C++ Programming

쉽게 풀어쓴 C 프로그래밍

C++-¿Ïº®Çؼ³10Àå

untitled

23_Time-Series-Prediction


Algorithm_Trading_Simple

?

쉽게 풀어쓴 C 프로그래밍

1

C 언어 프로그래밊 과제 풀이

09-interface.key

about_by5


<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

PowerPoint Template


Multi Channel Analysis. Multi Channel Analytics :!! - (Ad network ) Report! -! -!. Valuepotion Multi Channel Analytics! (1) Install! (2) 3 (4 ~ 6 Page

[PyConKR2017] 노가다 없는 텍스트 분석을 위한 한국어 NLP

dist=dat[:,2] # 기초통계량구하기 len(speed) # 데이터의개수 np.mean(speed) # 평균 np.var(speed) # 분산 np.std(speed) # 표준편차 np.max(speed) # 최대값 np.min(speed) # 최소값 np.me

Open Cloud Engine Open Source Big Data Platform Flamingo Project Open Cloud Engine Flamingo Project Leader 김병곤

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공

KT AI MAKERS KIT 사용설명서 (Node JS 편).indd

<BFB9BCFAB0E6BFB5C1F6BFF8BCBEC5CD5F BFB9BCFAB0E6BFB520C4C1BCB3C6C FB3BBC1F628C3D6C1BEBBF6BAAFC8AF292E706466>

슬라이드 1

17장 클래스와 메소드

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

교육2 ? 그림

Lab - Gradient descent Copyright 2018 by Introduction [PDF 파일다운로드 ]() 이번랩은우리가강의를통해들은 Gradient descent 을활용하여 LinearRegression

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

Spring Data JPA Many To Many 양방향 관계 예제

쉽게 풀어쓴 C 프로그래밍

Microsoft PowerPoint - Smart CRM v4.0_TM 소개_ pptx

PowerPoint 프레젠테이션

VZ94-한글매뉴얼

Macaron Cooker Manual 1.0.key

slide2

Week5

OCaml

API STORE 키발급및 API 사용가이드 Document Information 문서명 : API STORE 언어별 Client 사용가이드작성자 : 작성일 : 업무영역 : 버전 : 1 st Draft. 서브시스템 : 문서번호 : 단계 : Docum

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt

PowerPoint 프레젠테이션

MAX+plus II Getting Started - 무작정따라하기

Todo list Universal app

1.1 how to use jupyter notebook Esc 키를누른후 h 키를누르면누르면 jupyter notebook 의 cheat sheet 가나온다. jupyter notebook 에는 Command Mode, Edit Mode, 총두가지모드가있다. 셀을클릭

쉽게 풀어쓴 C 프로그래밍

PowerPoint 프레젠테이션

hlogin2

03장.스택.key

Lab-Numpyinanutshell Copyright 2018 document created by Introduction PDF 파일다운로드 오래기다리셨습니다. 드디어 Machin Learning 강의첫번째 Lab Assi

ARMBOOT 1

APCPCWM_ :WP_GLOBAL_PFWP_GLOBAL_PF APCPCWM_ :WP_GLOBAL_PFWP_GLOBAL_PF 예제로보는 네트워크엔지니어를위한 Python 101

<BFA9C7E0BEF720C1A6B5B5B0B3BCB1B9E6BEC82E687770>

JMF2_심빈구.PDF

Transcription:

파이썬을이용한빅데이터수집. 분석과시각화 Part 2. 데이터시각화 이원하

목 차 1 2 3 4 WordCloud 자연어처리 Matplotlib 그래프 Folium 지도시각화 Seabean - Heatmap 03 07 16 21

1 WORDCLOUD - 자연어처리

KoNLPy 형태소기반자연어처리 http://www.oracle.com/technetwork/java/javase/downloads/index.html http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype >>> from konlpy.tag import Kkma >>> from konlpy.utils import pprint >>> kkma = Kkma() >>> pprint(kkma.nouns(u' 명사만을추출하여워드클라우드를그려봅니다 ')) [' 명사 ', ' 추출 ', ' 워드 ', ' 워드클라우드 ', ' 클라우드 '] 4

KoNLPy 내부객체 5

KoNLPy & pytagcloud >>> from collections import Counter >>> color = ['red', 'blue', 'red', 'red'] >>> counter_color = Counter(color) >>> print(counter_color_a) Counter({'red': 3, 'blue': 1}) 6 jtbcnews_facebook_2017-01-01_2017-06-30.txt >>> from konlpy.tag import Twitter >>> from collections import Counter >>> import pytagcloud >>> import webbrowser >>> import re >>> openfilename = "c:/python_sample/jtbcnews_facebook_2017-01-01_2017-06-30.txt" >>> cloudimagepath = openfilename + ".jpg" >>> rfile = open(openfilename, 'r', encoding='utf-8').read() >>> data = re.sub(r'[^\w]', ' ', rfile) >>> nlp = Twitter() >>> nouns = nlp.nouns(data) >>> count = Counter(nouns) >>> wordinfo = dict() >>> for tags, counts in count.most_common(50): if (len(str(tags)) > 1): wordinfo[tags] = counts print ("%s : %d" % (tags, counts)) >>> taglist = pytagcloud.make_tags(dict(wordinfo).items(), maxsize=80) >>> pytagcloud.create_tag_image(taglist, cloudimagepath, size=(640, 480), fontname='korean', rectangular=false) >>> webbrowser.open(cloudimagepath)

21 MATPLOTLIB 그래프

Matplotlib 그래프 Package [ 파이썬설치경로 ]>pip install matplotlib >>> from matplotlib import pyplot >>> pyplot.plot([1,2,3,4],[10,30,20,40]) >>> pyplot.show() 8

Matplotlib 그래프 Package File "C:\python\lib\site-packages\matplotlib\font_manager.py", line 1412, in <module> fontmanager = pickle_load(_fmcache) def win32installedfonts(directory=none, fontext='ttf'): 중략 key, direc, any = winreg.enumvalue( local, j) if not is_string_like(direc): continue if not os.path.dirname(direc): direc = os.path.join(directory, direc) direc = direc.split( \0, 1)[0] # 파이썬경로문제해결 direc = os.path.abspath(direc).lower() 9

Matplotlib 그래프 Package >>> import matplotlib.pyplot as plt >>> plt.plot([1,2,3,4]) >>> plt.xlabel('x-axis label ) #x 축라벨타이틀설정 >>> plt.ylabel('y-axis label') #y 축라벨타이틀설정 >>> plt.show() >>> plt.plot([1,2,3,4],[1,2,3,4]) >>> plt.show() 10

Matplotlib 그래프 Package >>> plt.plot([1,2,3,4], [1,2,3,4], 'ro') >>> plt.show() 11

Matplotlib 그래프 Package >>> plt.plot([1,2,3,4],[1,2,3,4],'r-', [1,2,3,4],[3,4,5,6],'v-') >>> plt.show() >>> from matplotlib import font_manager, rc >>> import matplotlib >>> font_location = "c:/windows/fonts/malgun.ttf" >>> font_name = font_manager.fontproperties(fname=font_location).get_name() >>> matplotlib.rc('font', family=font_name) >>> plt.plot([1,2,3,4]) >>> plt.xlabel('x축한글표시 ') >>> plt.show() 12

Matplotlib 그래프 Package >>> plt.figure() >>> plt.subplot(1, 2, 1) >>> plt.plot([1,2,3,4], [1,2,3,4]) >>> plt.subplot(1, 2, 2) >>> plt.plot([5,6,7,8],[5,6,7,8]) >>> plt.show() 13

Matplotlib 그래프 Package >>> plt.plot([1,2,3,4], [1,2,3,4]) >>> plt.xlabel('x축 ') >>> plt.ylabel('y축 ') >>> plt.title('matplotlib 활용 ') >>> plt.text(3.5, 3.0, ' 평균 :2.5') >>> plt.grid(true) >>> plt.show() 14

Matplotlib 그래프 Package jtbcnews_facebook_2017-01-01_2017-06-30.txt >>> from konlpy.tag import Twitter >>> from collections import Counter >>> import pytagcloud >>> import webbrowser >>> import re >>> openfilename = "c:/python_sample/jtbcnews_facebook_2017-01- 01_2017-06-30.txt" >>> cloudimagepath = openfilename + ".jpg" >>> rfile = open(openfilename, 'r', encoding='utf-8').read() >>> data = re.sub(r'[^\w]', ' ', rfile) >>> nlp = Twitter() >>> nouns = nlp.nouns(data) >>> count = Counter(nouns) >>> wordinfo = dict() >>> for tags, counts in count.most_common(50): if (len(str(tags)) > 1): wordinfo[tags] = counts print ("%s : %d" % (tags, counts)) >>> import matplotlib.pyplot as plt >>> from matplotlib import font_manager, rc >>> import matplotlib >>> font_location = "c:/windows/fonts/malgun.ttf" >>> font_name = font_manager.fontproperties(fname=font_location).get_name() matplotlib.rc('font', family=font_name) >>> plt.xlabel(' 주요단어 ') >>> plt.ylabel(' 빈도수 ') >>> plt.grid(true) >>> Sorted_Dict_Values = sorted(wordinfo.values(), reverse=true) >>> Sorted_Dict_Keys = sorted(wordinfo, key=wordinfo.get, reverse=true) >>> plt.bar(range(len(wordinfo)), Sorted_Dict_Values, align='center') >>> plt.xticks(range(len(wordinfo)), list(sorted_dict_keys), rotation='70') >>> plt.show() 15

21 FOLIUM 지도시각화

Folium 지도시각화 Package [ 파이썬설치경로 ]>pip install folium >>> import folium >>> map_osm = folium.map(location=[37.566345, 126.977893]) >>> map_osm.save( c:/python_sample/map1.html') 17

Folium 지도시각화 Package >>> import folium >>> map_osm = folium.map(location=[37.566345, 126.977893], zoom_st art=17) >>> map_osm.save( c:/python_sample/map2.html') >>> import folium >>> map_osm = folium.map(location=[37.566345, 126.977893], zoom_st art=17, tiles='stamen Terrain') >>> map_osm.save('c:/python_sample/map3.html') >>> map_osm = folium.map(location=[37.566345, 126.977893], zoom_st art=17, tiles='stamen Toner') >>> map_osm.save('c:/python_sample/map4.html') 18

Folium 지도시각화 Package >>> map_osm = folium.map(location=[37.566345, 126.977893], zoom_start=17) >>> folium.marker([37.566345, 126.977893], popup=' 서울특별시청 ').add_to(map_osm) >>> folium.marker([37.5658859, 126.9754788], popup=' 덕수궁 ').add_to(map_osm) >>> map_osm.save(c:/python_sample/map5.html')

Folium 지도시각화 Package import urllib.request import json import folium import webbrowser if (retdata == None): return None else: return json.loads(retdata) def get_request_url(url): client_id = "PIKKM1p_iFKvlrgZdyk3" client_secret = "scxkesjyib" req = urllib.request.request(url) req.add_header("x-naver-client-id", client_id) req.add_header("x-naver-client-secret", client_secret) try: response = urllib.request.urlopen(req) if response.getcode() == 200: return response.read().decode('utf-8') except Exception as e: print(e) return None def getgeodata(address): base = "https://openapi.naver.com/v1/map/geocode" parameters = "?query=%s" % urllib.parse.quote(address) url = base + parameters retdata = get_request_url(url) def main(): address = input(" 주소를입력하세요 : ") jsonresult = getgeodata(address) if (jsonresult == None): print (" 주소검색결과가없습니다 ") elif 'result' in jsonresult.keys(): lattitude = jsonresult['result']['items'][0]['point']['y'] longitude = jsonresult['result']['items'][0]['point']['x'] map_osm = folium.map(location=[lattitude, longitude], zoom_start=17) folium.marker(location=[lattitude, longitude], popup=address).add_to(map_osm) map_osm.save('c:/python_sample/address.html') webbrowser.open('c:/python_sample/address.html') else: print (" 주소검색결과가없습니다 ") if name == ' main ': main()