Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PythonとTableauで福岡のオープンデータを可視化してみた。
Search
Taka710
December 27, 2018
Technology
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PythonとTableauで福岡のオープンデータを可視化してみた。
Pydata.Fukuoka#1のLT資料
Taka710
December 27, 2018
Other Decks in Technology
See All in Technology
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.1k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.4k
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
HHKBエバンジェリストになる方法
941
0
110
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2k
データ_AIの事業の勝敗をわけるもの
nek0128
1
400
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
4
210
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
980
Goodbye ShellScript, Hello File-based App
shunsock
0
120
iOSDC Japan 2026 day1 TrackC 10:50
feedtailor
1
160
人間はどの意思決定を手放せるのか
kawasima
15
7.1k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
My Coaching Mixtape
mlcsv
0
310
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
WENDY [Excerpt]
tessaabrams
14
39k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Docker and Python
trallard
47
4.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
810
Practical Orchestrator
shlominoach
192
12k
Transcript
PythonͱTableauͰ ԬͷΦʔϓϯσʔλ(ਓޱ)ΛՄࢹԽͯ͠Έͨ
ࣗݾհ • ⅓ɹܟതʢ·ɹ͔ͨͻΖʣ • ϓϩδΣΫτϚωʔδϟʔͬͯ·͢ɻ • PythonͱTableau͕େ͖Ͱ͢ʂ • PyCon Kyushu࣮ߦҕһͬͯ·͢ɻ
ࠓճΔ͜ͱ • ԬݝͷΦʔϓϯσʔλαΠτ͔Βࢢ۠ொଜ ͷਓޱσʔλΛՄࢹԽ͢Δ
ࠓճ͏ͷ • Python 3.6 • xlrd ɿexcelϑΝΠϧΛಡΈॻ͖͢ΔPKG • gspread ɿgoogle
spreadΛಡΈॻ͖͢ΔPKG • Tableau PublicʢDesktopʣ • ηϧϑBIπʔϧ • ແྉ൛ • Tableau PublicαΠτʹ͔͠อଘ͕Ͱ͖ͳ͍
ߏ 1. xlrdΛͬͯΦʔϓϯσʔλΛऔΓࠐΈ 2. σʔλΛՃͯ͠ɺgoogle spreadʹॻ͖ࠐΈ 3. Tableau PublicͰσʔλΛಡΈࠐΜͰՄࢹԽ
1.excelϑΝΠϧΛಡΈࠐΈ • xlsxϑΥϧμʹΦʔϓϯσʔλΛஔ͠ɺ ϑΝΠϧΛಡΈࠐΉؔΛ࡞ def get_xlsx_file_path(): main_path = os.path.dirname(os.path.abspath(__name__)) xlsx_path
= os.path.join(main_path, ‘xlsx/*’) for xls_list in glob(xlsx_path): yield xls_list
2.excelϑΝΠϧΛಡΈࠐΈ • ਓޱͷΦʔϓϯσʔλͷ͏ͪෆཁͳσʔλΛ আ֎ͯ͠ಡΈࠐΈ • ࢢ܊ɺ۠ொΛར༻͢ΔͨΊεΩοϓ • for i in
range(EXCEL_START_ROW, sheet.nrows - 1): if sheet.cell_value(i, 2) in DISTRICT: continue else: xls_data = [ file_date.strftime('%Y-%m-%d'), sheet.cell_value(i, 2), sheet.cell_value(i, 6), sheet.cell_value(i, 7), sheet.cell_value(i, 8), sheet.cell_value(i, 9) ] yield xls_data
3.google_spreadʹొ • γʔτ໊Λࢦఆͯ͠εϓϨουΛΦʔϓϯ • ྻຖʹεϓϨουΛߋ৽ google_sheet = gc.open(‘fukuoka_open_data').sheet1 ɾɾɾ for
index, record in enumerate(get_xlsx_data(path)): cell_list = google_sheet.range(index + s_row, 1, index + s_row, len(record)) for cell, val in zip(cell_list, record): cell.value = val google_sheet.update_cells(cell_list) next_row = index + s_row + 1
4.Tableau PublicͰՄࢹԽ • πϦʔϚοϓΛ࡞ͬͯΈ·ͨ͠
4.Tableau PublicͰՄࢹԽ • ਤͰՄࢹԽͯ͠Έ·ͨ͠ɻ
4.Tableau PublicͰՄࢹԽ • ࠷ऴతʹͪ͜Β https://public.tableau.com/profile/takahiro.hama8517#!/vizhome/ populationofFukuokaprefecture/fukuokapopulation GitHub: https://github.com/Taka710/fukuoka_open_data
Tableau࠷ߴʂ
͓·͚ • ͔ͤͬ͘ͳͷͰGoogle DataPortalͬͯΈͨɻ ؆୯ʹՄࢹԽͰ͖Δͷ͍͍͔ɻ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ