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
M5Stackで作る BLEマウス GPSログの世界
tomokusaba
PRO
0
440
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
290
Rust で関数型ドメインモデリング
takonda
0
170
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
180
20261017福岡devIO 「AIは"良いダッシュボード"を作れるか?
jtakeda
0
180
Refining Active Record
shugo
0
160
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
5k
DGX Spark でどこまでハッキングができるのか?
kash1064
3
1.4k
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
大型犬好きによるPugの紹介
yamanoku
1
160
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Docker and Python
trallard
47
4.2k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
My Coaching Mixtape
mlcsv
0
360
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Thoughts on Productivity
jonyablonski
76
5.4k
Navigating Weather and Climate Data
rabernat
0
560
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ͬͯΈͨɻ ؆୯ʹՄࢹԽͰ͖Δͷ͍͍͔ɻ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ