Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PyConJP 2015: Dask: 軽量並列計算フレームワーク (Lightning ta...
Search
Sinhrks
October 10, 2015
Programming
16k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PyConJP 2015: Dask: 軽量並列計算フレームワーク (Lightning talks)
Sinhrks
October 10, 2015
More Decks by Sinhrks
See All by Sinhrks
daskperiment: Reproducibility for Humans
sinhrks
1
450
PythonとApache Arrow
sinhrks
6
2.1k
大規模データの機械学習におけるDaskの活用
sinhrks
10
3.3k
機械学習と解釈可能性
sinhrks
7
5.8k
LIME
sinhrks
2
1.5k
データ分析言語R 1年の振り返り
sinhrks
5
2.6k
pandasでのOSS活動事例と最初の一歩
sinhrks
2
20k
Dask Distributedによる分散機械学習
sinhrks
4
1.6k
Data processing using pandas and Dask
sinhrks
1
300
Other Decks in Programming
See All in Programming
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
110
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
130
이 함수, 실패하면 어떻게 되나요? null부터 Rich Errors까지, Kotlin 에러 처리 15년
haeti2
0
110
typoなんかねぇよ
raspython3
0
640
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
130
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
190
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.6k
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
50
31k
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
130
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
120
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
150
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
410
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
430
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
390
Mobile First: as difficult as doing things right
swwweet
225
10k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
570
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
230
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Designing for Performance
lara
611
70k
Transcript
Dask ܰྔฒྻܭࢉϑϨʔϜϫʔΫ
ࣗݾհ • Data Analyst • OSS ׆ಈ: • PyData Development
Team (pandasίϛολ) • Blaze Development Team (Daskίϛολ) • GitHub: https://github.com/sinhrks
Dask • ܰྔฒྻࢄϑϨʔϜϫʔΫ (ϊʔυฒྻ͕ओ) • NumPy, PyToolz, pandasͷAPI (αϒηοτ) Λ
ͭσʔλߏΛఏڙ αϒϞδϡʔϧ ϕʔεύοέʔδ EBTLBSSBZ /VN1ZOEBSSBZ EBTLCBH 1Z5PPM[ MJTU TFU EJDUʹର͢Δॲཧ EBTLEBUBGSBNF QBOEBT%BUB'SBNF
DataFrame • pandas.DataFrame: ϥϕϧ͖ͷ2࣍ݩσʔλ • Dask.DataFrame: pandas.DataFrame Λׂͯ͠ ॲཧ QBOEBT%BUB'SBNF
%BTL%BUB'SBNF
Dask DataFrame import pandas as pd df = pd.DataFrame({'X': np.arange(10),
'Y': np.arange(10, 20), 'Z': np.arange(20, 30)}, index=list('abcdefghij')) df import dask.dataframe as dd ddf = dd.from_pandas(df, 2) ddf dd.DataFrame<from_pandas-…, divisions=('a', 'f', 'j')> ߦྻͷ QBOEBT%BUB'SBNFΛ࡞ σʔλΛ෦తʹͭʹׂ͠ɺ %BTL%BUB'SBNFΛ࡞
DaskͰͷܭࢉॲཧ ddf + 1 dd.DataFrame<elemwise-…, divisions=('a', 'f', 'j')> (ddf +
1).compute() EG EEG DPNQVUF EEG શମʹΛՃࢉɻ ࣮ࡍͷܭࢉॲཧ·࣮ͩߦ͞Εͳ͍ ܭࢉΛ࣮ߦ
Blocked Algorithm (Ճࢉ) $PODBU (ddf + 1).compute() ॲཧલͷ
QBOEBT%BUB'SBNF %BTL%BUB'SBNF ʹม ׂ͞Εͨσʔλʹରͯ͠ ܭࢉ࣮ߦ݁ՌΛ݁߹ ॲཧޙͷ QBOEBT%BUB'SBNF
Blocked Algorithm (߹ܭ) ddf.sum().compute() 4VN 4VN $PODBU 4VN TVN ճ
DPODBU TVN ճ
Blocked Algorithm (߹ܭ) ddf.sum().visualize() TVN ճ DPODBU TVN ճ ॲཧલͷ
%BTL%BUB'SBNF
Blocked Algorithm (ฏۉ) ddf.mean().visualize() TVN DPVOU NFBOTVNDPVOU
Blocked Algorithm (ཁ౷ܭྔ) ddf.describe().visualize() ݁Ռ
Dask DataFrameͷػೳ • ࢛ଇԋࢉ/ൺֱԋࢉ • ౷ܭྔ • ϥϕϧʹΑΔσʔλબ • άϧʔϓԽ
/ ू • ࿈݁/݁߹ (merge, join, concat…)
ύϑΥʔϚϯεൺֱ • AWS EC2: c4.2xlarge (vCPU: 8, ϝϞϦ: 15 GiB)
n = 100000000 df = pd.DataFrame({'a': np.random.randint(1, 100, n), 'b': np.random.randn(n)}) df ddf = dd.from_pandas(df, 5) ddf dd.DataFrame<from_pandas-…, divisions=(0, 20000000, 40000000, 60000000, 80000000, 99999999)> ԯߦྻͷ QBOEBT%BUB'SBNFΛ࡞ σʔλΛ෦తʹͭʹׂ͠ɺ %BTL%BUB'SBNFΛ࡞
ύϑΥʔϚϯεൺֱ %timeit df.describe() 1 loops, best of 3: 25.3 s
per loop %timeit ddf.describe().compute() 1 loops, best of 3: 3.87 s per loop QBOEBT %BTL
݁Ռ • ※ percentile ۙࣅΞϧΰϦζϜΛར༻͢ΔͨΊɺ ʹࠩҟ͕ग़Δ߹͕͋Δ () df.describe() ddf.describe().compute() QBOEBT
%BTL
݁Ռ ddf.describe().visualize()
·ͱΊ • Dask: ܰྔฒྻࢄϑϨʔϜϫʔΫ • NumPy, PyToolz, pandas ͷAPIͷαϒηοτΛ ఏڙ
• Ϣʔβ NumPy / PyToolz / pandas ͷ API Λ ར༻ͯ͠ฒྻܭࢉ͕Ͱ͖Δ