Slide 1

Slide 1 text

Pythonista’s Batting Eye Shinichi NAKAGAWAʢ໺ٿΤϯδχΞʣ a.k.a. @shinyorke NEXT BASE Corp. Chief Technology Officer PyCon JP 2018 Talk Session 2018/9/17 Pythonistaͷબٿ؟ʢͤΜ͖Ύ͏͕Μʣ

Slide 2

Slide 2 text

ൃදͷલʹ…͓ئ͍ :bow: • ϓϩΞϚ໰Θͣɺ೔ຊͷ໺ٿʹؔ͢Δ࣭໰ɾ͝ҙݟʹ
 ͍ͭͯ͸͓౴͑Ͱ͖·ͤΜʢ͓࢓ࣄͳͷͰ͓࡯͍ͩ͘͠͞ʣ • ϝδϟʔϦʔάʹ͍ͭͯ͸ՄೳͳݶΓ౴͑·͢
 ˞͜ͷൃදͷ୊ࡐͰ͢ • Pythonɾٕज़ͷ࿩͸جຊతʹ͓౴͑͠·͢
 ˞ۀ຿ʢ໺ٿʣʹ఍৮͠ͳ͍ݶΓ • ίʔυ͸ެ։͠·ͤΜɺεϥΠυ͸ެ։͠·͢
 ࣸਅɾSNSγΣΞ͸ΨϯΨϯͪ͠Ό͍ͬͯͩ͘͞ʂ

Slide 3

Slide 3 text

ʊਓਓਓਓਓਓਓਓਓਓʊ ʼɹಥવͷ໺ٿΫΠζɹʻ ʉY^Y^Y^Y^Y^Y^Y^Y^Yʉ

Slide 4

Slide 4 text

ϝδϟʔϦʔά ࠓγʔζϯͷϗʔϜϥϯԦ ͱ͍͑͹ʂʁ ※2018/9/17(JST)ݱࡏ,྆Ϧʔά౷ҰԦऀ

Slide 5

Slide 5 text

ʲ౴ʳΫϦεɾσʔϏε • Khris Davis,௨শʮKhrushʯ • Ξ੢஍۠ΞεϨνοΫεͷओ๒ • 3೥࿈ଓ40ຊྥଧҎ্(2016ʙ2018)
 ※ࠓγʔζϯ43ຊྥଧ(9/17 JSTݱࡏ) • ӈ౤ӈଧ,എ൪߸2 • ʮ࢛൪DHʯ,૸ྥͱकඋ͸μϝ • ਎௕180cm/86kgɺҙ֎ͱখ͍͞ ݩը૾ɿWikipedia

Slide 6

Slide 6 text

஌Βͳ͍ͬ͢ΑͶʢ࡯͠ʣ σʔλͰ͓ݟͤ͠·͢Ͷ #σϞ͠·͢

Slide 7

Slide 7 text

σʔλͰݟͯΈΑ͏ᶃ ࠨ͔Βଧٿ݁Ռɺώοτνϟʔτɺଧٿछผ

Slide 8

Slide 8 text

σʔλͰݟͯΈΑ͏ᶃ ࠨ͔Βଧٿ݁Ռɺώοτνϟʔτɺଧٿछผ

Slide 9

Slide 9 text

σʔλͰݟͯΈΑ͏ᶄ ࠨ͔Βଧٿ଎౓ɺඈڑ཭ɺ଎౓×֯౓

Slide 10

Slide 10 text

σʔλͰݟͯΈΑ͏ᶄ ࠨ͔Βଧٿ଎౓ɺඈڑ཭ɺ଎౓×֯౓

Slide 11

Slide 11 text

ϗʔϜϥϯʢؚΉ௕ଧʣ ͕ग़΍͍͢κʔϯ͕ଘࡏ͢Δ ͱ͍͏͜ͱ͕Θ͔͖ͬͯͨ

Slide 12

Slide 12 text

ʮੌ͍଎౓×͍͍֯౓ʯͰඈڑ཭͸৳ͼΔ ՊֶͱσʔλͷݕূʹΑΓɺ଎౓×֯౓ͷ૊Έ߹ΘͤͰඈͿ͜ͱ͕Θ͔ͬͯΔ ϝδϟʔͰ͸ʮόϨϧɾκʔϯʯͱݺ͹Ε͍ͯ·͢&kwsk͸ϕʔεϘʔϧΪʔΫεͰʂ ݩը૾ɿhttp://m.mlb.com/glossary/statcast/barrel

Slide 13

Slide 13 text

ʮ଎͍ϑϥΠΛଧͯʯ #ҙ༁ ଧٿ଎౓Λ্͛ͯɺఔΑ͍֯౓Ͱඈ͹͢ͱ৳ͼΔ ※஫ɿ֯౓্͕͕Γ͗͢Δͱଧٿ͕৳ͼͳ͍

Slide 14

Slide 14 text

όϨϧɾκʔϯʹ౰ͯ͸ΊΔͱ Jupyter + BokehͰόϨϧΛ࡞ਤʢ໢ֻ͚෦෼ʣ ώοτੑଧٿͷ଎౓͕ߴ͍ɺ௕ଧ͸֯౓͕͋Δ͜ͱ͕Θ͔ΔͩΖ͏͔ʁ

Slide 15

Slide 15 text

ϗʔϜϥϯԦͷͻΈͭ • ଧٿ଎౓Λ৳͹͢ʢ160km/hҎ্ʣ • ͍͍ײ͡ͷ֯౓ʹඈ͹͢ • ૯ͯ͡ɺʮϑϥΠΛଧͭ౒ྗΛ͢Δʯ
 ˠʮϑϥΠϘʔϧֵ໋ʯ͍ͬͯ͏΍ͭͰ͢ • ϑϥΠΛଧͭͨΊͷϘʔϧͷݟۃΊͱٕज़͕େࣄ

Slide 16

Slide 16 text

ϘʔϧΛݟۃΊΔʮબٿ؟ʯ ͱ͍͏ٕज़͕͘͢͝େࣄ ϑϥΠΛଧٕͭज़ͱηοτͰ ௕ଧ͸୔ࢁੜ·ΕΔ

Slide 17

Slide 17 text

ͦͯ͠զʑΤϯδχΞ ͓ΑͼPythonistaʹ΋ ʮબٿ؟ʯ͕ଘࡏ͢Δ #ຊ೔ͷςʔϚ

Slide 18

Slide 18 text

͓ͬͱɺࣗݾ঺հΛ ๨Ε͓ͯΓ·ͨ͠

Slide 19

Slide 19 text

໺ٿΤϯδχΞͰ͢ • PyCon JPΛΩοΧέʹʮϗϯτʹ໺ٿͷਓʯ
 ʹͳͬͨʮ໺ٿͷΤϯδχΞɾݚڀऀʯͰ͢ • Shinichi NAKAGAWA(@shinyorke) • ʢגʣωΫετϕʔε ໺ٿΤϯδχΞ݉CTO • Python΋͘΋ࣗ͘शࣨʢ#rettypyʣΦʔΨφΠβʔ • ʲCareerʳITίϯαϧˠϦΫϧʔτˠRetty→΍͖͏ • ຊ৬͸αʔόʔαΠυΤϯδχΞɺࠓ͸ԿͰ΋԰ɺڕྉཧେ޷͖

Slide 20

Slide 20 text

ʲCMʳωΫετϕʔε #ͱ͸ • Innovations For All Athletes
 (શͯͷΞεϦʔτʹٕज़ֵ৽Λ) • τϥοΫϚϯ(υοϓϥʔϨʔμʔ)
 ͔ΒಘΒΕͨ౤ٿσʔλΛղੳ͠,
 ෼ੳɾՄࢹԽΛߦ͏ϓϩμΫτʮBACSʢόοΫεʣʯΛٿஂɾબखʹఏڙ • ϓϩΞϚ໰Θͣɺ໺ٿνʔϜɾબखͷಈ࡞ղੳɾӡӦαϙʔτetc… • ͦͷଞϝσΟΞࣄۀͳͲͳͲɺৄ͘͠͸ https://nextbase.co.jp/ • ݱࡏΤϯδχΞืूதͰ͢ʂҰॹʹεϙʔπΛՊֶ͓ͯ͠΋͠Ζ͍ੈͷதΛ࡞Ζ͏ʂ ※BACS͸ʮBaseball Analytics and Coaching Systemʯͷུ

Slide 21

Slide 21 text

ʲCMʳBaseball Geeks • ໺ٿͷʮະདྷʯΛൃ৴͢ΔϝσΟΞͰ,ωΫετϕʔεͰӡӦ͍ͯ͠·͢ • σʔλɾεϙʔπՊֶͰ໌Β͔ʹͳͬͨ͜ͱΛʮΘ͔Γ΍͘͢ʯ఻͑Δ • ΈΜͳಡΜͰͶ&ϒΫϚ΋ΑΖ͘͠ʂ https://www.baseballgeeks.jp/

Slide 22

Slide 22 text

ʲCMʳPython΋͘΋ࣗ͘शࣨ #rettypy • ࢲ͕Ҏલࡏ੶͍ͯͨ͠RettyͷΤϯδχΞ஥ؒͱڞʹ։࠵͍ͯ͠Δ΋͘΋͘ձ • झࢫ&Ϟοτʔ • ֤ࣗ,͓୊Λ࣋ࢀͯ͠ʮࣗश(΋͘΋͘)ʯ͢Δ • ൃදɾࡶஊΛ௨ͯ͡৘ใަ׵΍ֶͼΛಘΔ • ΠΠΰϋϯ(ϥϯνɾ͓΍ͭ)Λ༇͠Ή • ॳ৺ऀ͔ΒΤόϯδΣϦετ·Ͱଟछଟ༷ͳࢀՃϝϯόʔ • ࣍ճ͸ࠓि຤ʢ9/22౔ʣͰ͢ɺདྷͯͶ https://retty.connpass.com/event/100173/

Slide 23

Slide 23 text

PyCon JPͱ໺ٿʢ5೥໨ʣ • 2014ɿDjango(WebΞϓϦ),ηΠόʔϝτϦΫε • 2015ɿ෼ੳج൫ͱPyData,ΞμϜɾμϯ཰ • 2016ɿϏοάσʔλղੳ,Pitch f/x(pitchpx) • 2017 ɿ෼ੳΞϯυՄࢹԽج൫ϦχϡʔΞϧ,ಘ఺Ձ஋ • 2018ɿ্هΛ͢΂ͯҰ৽͓ͯ͠ಧ͚ˡNewʂ

Slide 24

Slide 24 text

໺ٿ෼ੳج൫ʮMortonʯ • PyCon JP 2014ʙ2017Ͱഓ͖ͬͯͨϊ΢ϋ΢Λू݁͠ɺ
 σʔλऩूʙ෼ੳʙՄࢹԽΛϦχϡʔΞϧͨ͠৽࣌୅ͷ໺ٿج൫ • ॳ୅(2014)ͷʮNo Ballʢ໺ٿʣʯɺ2017ʮBradfordʯͷػೳʹ
 Ճ͑ɺτϥοΩϯάσʔλͷ෼ੳΛ৽ͨʹ௥Ճ • ໊લ͸τϥοΩϯάσʔλͰ࠶ධՁ͞Εͨϝδϟʔ۶ࢦͷ
 ઌൃӈ࿹ʮνϟʔϦʔɾϞʔτϯʢݱΞετϩζʣʯ͔Βഈआ
 ˠৄ͘͠͸ʮϏοάσʔλɾϕʔεϘʔϧʯ͍ͬͯ͏ຊʹ͋Γ·͢


Slide 25

Slide 25 text

ຊ೔͓࿩͢ΔϞϊͷશମ૾

Slide 26

Slide 26 text

࢖ͬͨ΋ͷҰཡɹ˞୅දతͳ΋ͷ ϙΠϯτ *1ZUIPOʢ%PDLFSͷ1ZUIPOެࣜΠϝʔδΛར༻ʣ *8FCΞϓϦɿ/VYUKT %KBOHP *෼ੳɾՄࢹԽɿ+VQZUFS #PLFI *໺ٿՊֶܭࢉɿQBOEBT TBCS˞ࣗ࡞ *ϓϥοτϑΥʔϜɿ-VJHJ *Ϋϥ΢υɾΠϯϑϥɿ%PDLFS$&GPS.BD *ͳ͓ɺଞʹ΋৭ʑ࢖ͬͯ·͢ʢ42-"MDIFNZͳͲʣ

Slide 27

Slide 27 text

ຊ೔ͷ͓͠ͳ͕͖ʢPythonʣ • Django REST Framework + Nuxt.jsͰSPA • LuigiΛ༻͍ͨ௒ָͪΜͳύΠϓϥΠϯ • PyDataͰͬ͘͞ΓϓϩτλΠϐϯά

Slide 28

Slide 28 text

Django REST FrameworkͱNuxt.js PythonͰWebͱ͍͑͹Djangoͦͯ͠JSͩͱSPA͕དྷͯ·͢Ͷͱ. ઌ΄ͲͷΫϦεɾσʔϏεͷ݅Ͱ͓ݟͤͨ͠΍ͭͰ͢.

Slide 29

Slide 29 text

ຊ೔͓࿩͢ΔϞϊͷશମ૾ ࠓ͜͜

Slide 30

Slide 30 text

Python×σʔλ෼ੳͷ Πϝʔδ͕ڧ͍໺ٿPython ॳͷ࡞඼͸DjangoͰͨ͠

Slide 31

Slide 31 text

PythonͰ͸͡ΊΔ໺ٿϓϩάϥϛϯά (2014) ౰࣌͸ϑΝϯλδʔϕʔεϘʔϧʢιγϟήʣ ʹউͭͨΊͷσʔλ෼ੳΛ໨ࢦ͍ͯͨ͠

Slide 32

Slide 32 text

࠶ͼDjangoʹ෣͍໭ͬͨϫέ • Web͓ΑͼPythonͷ4೥ؒͷਐԽʹ௥ਵʢޙड़ʣ • SPAʢSingle Page Applicationʣ࡞Γͱϝϯς͕࢓ࣄʹ
 ˠͪͳΈʹ,ฐࣾBACS͸Vue.js੡ͷSPA • ࠓޙͷϓϩμΫτ։ൃɾٕज़બఆʹ޲͚ͯͷΩϟονΞοϓ
 ˠҰԠCTOͳͷͰɺʮखΛಈ͔ͯ͠ʯੜ͖ͨ஌ࣝΛशಘ • ࠷ۙDjango͕ϒʔϜͬΆ͍ͷͰ࠶ͼ೾ʹ৐Δ #νϟϥ͍

Slide 33

Slide 33 text

PyCon JP 2014͔ΒͷਐԽ • Pythonɿ3.4→3.7 • Djangoɿ1.7→2.1 • Bootstrapϕʔεͷී௨ͷWebΞϓϦˠSPA • άϥϑϥΠϒϥϦ΋ચ࿅͞Εͨ(Chart.jsͳͲ) • ໺ٿσʔλɺ৽ͨʹʮτϥοΩϯάσʔλʯ͕ՃΘΔʂ
 ˠMLBެೝͷʮBaseball Savantʯͱ͍͏σʔληοτ͕ՃΘΓɺ
 ɹଧٿ଎౓΍֯౓ɺϘʔϧճస਺ͳͲ΋෼ੳͷର৅ʹ

Slide 34

Slide 34 text

Nuxt.js(Vue.js) • ղੳɾ෼ੳπʔϧͱͯ͠ٻΊΒΕΔϢʔβʔମݧʢUXʣΛ
 ׎͑ΔͳΒSPAͰ͠ΐ͏ʂͱ࠷ॳ͔Βબ୒ࢶ͸SPAҰ୒Ͱͨ͠ • ࢓ࣄͰVue.jsΛ΍ΓͭͭɺReactͳͲ΋͓ࢼ͠Ͱ৮ͬͯ
 ৭ʑߟ͑ͨʢࢼͨ͠ʣ݁ՌɺNuxt.jsʹͨͲΓண͍ͨ • Nuxt.js͸Vue.jsΛϕʔεʹͨ͠ϑϧελοΫͳSPA FW
 ϧʔϧʹैͬͯॻ͍ͯϏϧυͨ͠Βಈ͘΋ͷ͕खʹೖΔ • ؊৺ͷUI͓Αͼάϥϑ࿈ܞ͸.,Nuxt UIͰ΄΅΄΅࿫͑ͨ
 ˠ͓͔͛ͰPyConʢࠓ೔ʣʹؒʹ߹͏ɹ˞஫ɿͱ͸͍͑ਏ͔ͬͨ

Slide 35

Slide 35 text

Nuxt UIʙCore UIͷNuxt.js൛ • BootstrapϕʔεͷAdminʢ؅ཧʣը໘ͷ༗໊ͳ
 ύοέʔδͱͯ͠ʮCore UIʯ͍ͬͯ͏ͷ͕͋Δ • Core UIࣗମ͸৭ΜͳFWʢAnguler,VueͳͲʣʹ
 ରԠ͍ͯ͠Δ,ͦͷதʹNuxt.js൛͕ • Nuxt UI͍ͬͯ͏ౕΛForkͯ͠ಠ࣮ࣗ૷͠·ͨ͠
 https://github.com/muhibbudins/nuxt-coreui

Slide 36

Slide 36 text

Django REST Framework • UIपΓ͸Nuxt.jsʹ೚ͤ,Django͸JsonΛ΍ΓͱΓ͢Δ
 RESTful APIͱͯ͠ͷ໾ׂʹ஫ྗ
 →ϑϩϯτͱAPIͰ໾ׂ͕෼͔ΕΔ໌֬ͳਐԽ
 ʢઃܭํ਑ͱ͍͏ҙຯͰʣ • ͱ͍͏༁ͰDjango REST Frameworkͷग़൪ • ηΠόʔϝτϦΫεͷࢦඪ஋ܭࢉ͸SerializerͰ
 ៉ྷʹͰ͖ͨ :excellent:

Slide 37

Slide 37 text

SerializerͰࢦඪ஋ܭࢉ(งғؾ) from rest_framework import serializers from sabr.stats import Stats from mlb.models import Batter class BattingSerializer(serializers.HyperlinkedModelSerializer): ba = serializers.SerializerMethodField('batting_average') slg = serializers.SerializerMethodField('slugging') obp = serializers.SerializerMethodField('onbase') @classmethod def calc_single(cls, obj): return Stats.single(obj.h, obj.hr, obj.number_2b, obj.number_3b) @classmethod def calc_tb(cls, obj): return Stats.tb(cls.calc_single(obj), obj.hr, obj.number_2b, obj.number_3b) @classmethod def calc_avg(cls, obj): return Stats.avg(obj.h, obj.ab) @classmethod def calc_obp(cls, obj): return Stats.obp(obj.h, obj.bb, obj.hbp, obj.ab, obj.sf) @classmethod def calc_slugging(cls, obj): return Stats.slg(cls.calc_tb(obj), obj.ab) def batting_average(self, obj): return self.calc_avg(obj) def slugging(self, obj): return self.calc_slugging(obj) def onbase(self, obj): return self.calc_obp(obj) class Meta: model = Batting fields = ( # ※͜͜ʹSerializerͷcolumn͕ฒͿ )

Slide 38

Slide 38 text

REST FrameworkͰྑ͔ͬͨ • ߦϨϕϧͷࢦඪܭࢉΛSerializerͰ׬݁Ͱ͖Δ
 ˠSerializerMethodFieldͰhookͰ͖Δ, ςετ͠΍͍͢ʢςετ͸ॻ͍ͯͳ͍ʣ • SerializerMethodField্Ͱࢦඪܭࢉ
 ˠҎલࣗ࡞ͨ͠ʮsabrʯͱ͍͏ύοέʔδͰඞཁͳܭࢉ͕Ͱ͖ͨ
 ɹ͍͍ͪͪSQLͰܭࢉͨ͠Γؔ਺࡞ͬͨΓ͢Δख͕ؒল͚ͨ • DB΁ͷΫΤϦͱSerializerʢ໭Γ஋ʣͷ໾ׂɾ੹೚Λ෼͚Δ
 ˠViewͰΫΤϦൃߦ,SerializerͰ໭Γ஋੔ܗͱ៉ྷʹ෼͚͔͚ͯΔ
 ɹ݁Ռ,ݟ௨͕͠ྑ͍ʢϝϯς͠΍͍͢ʣίʔυʹ
 ɹͱ͸͍͑ਏ͔ͬͨ(´ɾωɾʆ)

Slide 39

Slide 39 text

Pythonistaͷબٿ؟(2018) Nuxt.jsͱDjango REST FrameworkͰચ࿅͞Εͨ݁Ռ͍͍ײ͡ʹ ࡉ͔͍ٕज़࿦ɾઃܭϊ΢ϋ΢͸͜ͷޙࡶஊ or PyLadies Tokyo 4प೥LT(10/8)Ͱʂ

Slide 40

Slide 40 text

LuigiΛ༻͍ͨ௒ָͪΜύΠϓϥΠϯ σʔλ͸ৗʹ৽͘͠ɺͦΕ΋ָʹӡ༻͠·͠ΐ͏ ࡞Δ΋ͷ΋গͳͯ͘͠Ͷͱ.

Slide 41

Slide 41 text

ຊ೔͓࿩͢ΔϞϊͷશମ૾ ࠓ͜͜

Slide 42

Slide 42 text

Luigi + pandasͰ೔࣍όον • Baseball Savant https://baseballsavant.mlb.com/
 ͷσʔλ͸೔ʑߋ৽͞ΕΔʢࢼ߹ཌ೔ʹ͸ެ։ʣ • ͬͯฉ͘ͱ,΍ͬͺ৽͍͠σʔλͰ෼ੳɾղੳΛ
 ͨ͘͠ͳΔΑͶʁʢྫɿࡢ೔ͷOhtani-sanͬͯʁʣ • ͬͯࣄͰ, Luigi + pandasͰ೔࣍Ͱσʔλऔಘͱ
 DBʢMySQLʣ΁ͷߋ৽Λߦ͏ύΠϓϥΠϯΛ࡞ͬͨ,ͪΐͬͱਏ͔͚ͬͨͲ • ࣮͸ڈ೥,RettyͰಉ͡Α͏ͳ࢓ࣄΛ͍ͯͯͦ͠ͷܦݧ͕ੜ͖ͨ
 ༧໿ಋઢΛ͑͞͞ΔPython੡όοΫΤϯυΛLuigi+pandas+ScrapyͰ࡞ͬͨϋφγ
 https://qiita.com/shinichi-nakagawa-r/items/f91ee099e5bce7cd5a4f

Slide 43

Slide 43 text

LuigiύΠϓϥΠϯʢֆʣ σϑΥϧτͰUI͕͋ΔͷͰؾ࣋ͪతʹָ ࠶࣮ߦ΋Luigiͷ࢓૊ΈͰΠέ·͢ͱʢػցֶशք۾ʹਓؾͳͷΘ͔Δʣ ॲཧதˠ ←ॲཧޙ

Slide 44

Slide 44 text

PyDataͰͬ͘͞ΓϓϩτλΠϐϯά ಘΒΕͨσʔλͰ͍͖ͳΓαʔϏε͸࡞Εͳ͍ ஍ಓͳ࣮ݧͱϓϩτλΠϐϯά͕͋ͬͯͦ͜

Slide 45

Slide 45 text

ຊ೔͓࿩͢ΔϞϊͷશମ૾ ࠓ͜͜

Slide 46

Slide 46 text

͜͜Ͱݴ͏PyData #ͱ͸ • PythonΛ༻͍ͨσʔλॲཧʢऔಘ,੔ܗ,෼ੳʣ
 ͳͲɺσʔλʹؔ͢ΔӦΈ͢΂ͯ • ػցֶशͳͲͷલॲཧͱ͔͕Α͋͘Δ΍ͭ • ํ๏͸ԿͰ΋ΞϦ͕ͩJupyter, pandasΛ
 ࢖͏͜ͱ͕ଟ͍ʢҹ৅ʣ

Slide 47

Slide 47 text

PyDataͰϓϩτλΠϐϯά • WebΞϓϦ(Django/Nuxt.js),όοΫΤϯυ(Luigi)͓Αͼσʔλߋ৽ɾલॲ ཧ͢΂ͯ, Jupyterͱpandas, BokehͰϓϩτλΠϐϯάͨ͠ • ࢼ͠ॻ͖ͨ͠Γσόοάͨ͠Γ͢Δͷʹ,ϒϥ΢βͰಈ͘؀ڥ͸
 ͱͯ΋΍Γ΍͍͢ʢؾܰʹ࡞ͬͯյͤΔʣ. • ιϑτ΢ΣΞͷʮՁ஋ʯ͸ৗʹTry and ErrorΛ܁Γฦ͠ͳ͕Βਫ਼៛Λ
 ্͛ΔϞϊ,͜͏͍ͬͨ࡞ۀ͸Jupyter࠷ڧ • ର৅σʔλΛʮࣂ͍ͳΒ͢ʯ·Ͱ΍Δͷ͕ϕετ.
 ͪΌΜͱ࡞Γ࢝Ί͔ͯΒਏΈΛຯΘ͏ΑΓίετֻ͕͔Βແͯ͘ྑ͍.

Slide 48

Slide 48 text

ࠓճ׆༂ͨ͠Ϟϊ • Bokehʢάϥϑඳըʣ • ࢄ෍ਤ΍ԁάϥϑ • ׳Εͳ͍JSͰඳ͘લʹ
 ଘ෼ʹ࣮ݧ • pandasʢσʔλॲཧʣ • CSVΛॲཧͨ͠Γ • DB͔Β௚઀σʔλΛҾ͍ͨΓ • ܽଛ஋ॲཧͱ͔େ׆༂ • ͜ΕΒΛJupyterͰ͍͍ײ͡ʹॲཧ

Slide 49

Slide 49 text

ͦͷଞͷͩ͜ΘΓϙΠϯτ • Sean LahmanʢηΠόʔσʔλʣDBߏங • PyCon JP 2014Ͱ࡞ͬͨϚΠάϨʔγϣϯπʔϧʢࣗ࡞ʣΛ࢖ͬͯܭࢉ • εΩʔϚ͕มΘͬͨ෼Λ৽نͰ։ൃʢେͯ͠ਏ͘ͳ͔ͬͨʣ • Docker • Ϋϥ΢υαʔϏεͰͷӡ༻͓Αͼ,ଞϝϯόʔ΁ͷಈ͘΋ͷڞ༗ • ϗϯτ͸K8SԽ͔͕ͨͬͨؒ͠ʹ߹Θͣorz #rettypy Ͱ΍Δͱࢥ͏ • ։ൃɾςετ͸Ұ؏ͯࣗ͠෼ͷPC্ɺPyCharmΛ׆༻ͯ͠΍Γ·ͨ͠

Slide 50

Slide 50 text

ͱ͜ΖͰօ͞Μ ͖͔ͬ͞Βʮ͋Δදݱʯ͕ ଟ͍͜ͱʹ͓ؾ͖ͮͩΖ͏͔ʁ

Slide 51

Slide 51 text

ਏ͔ͬͨ ਏ͔ͬͨ(´ɾωɾʆ) ਏΈΛຯΘ͏ ͳΔ΄Ͳʁ

Slide 52

Slide 52 text

໺ٿʹ͸ʮਏ͍ʯ͜ͱ͕25ʙ334ݸ͘Β͍͋ΔʢΠϝʔδʣ ※ಛఆͷݸਓΛࢥ͍͍ͭͨํ,ଟ෼Կ͔ͷצҧ͍Ͱ͢ʢ๮ʣ

Slide 53

Slide 53 text

ʲۓٸݕূʳεϥΠμʔ͸ਏ͍ʁ • ๭ܝࣔ൘Ͱ༗໊ͳʮ֎εϥ͸ਏ͍ʯ͸ຊ౰͔ʁ • PyDataͱϝδϟʔͷ
 τϥοΩϯάσʔλͰ
 Θ͔Δ͔΋͠Εͳ͍ • ͬͯࣄͰωλͬΆ͘ݟͯΈ·͢
 ର৅͸ϝδϟʔϦʔΨʔ
 
 ˞࢓ࣄͰ͸͜Μͳద౰ͳࣄ͸͠·ͤΜ
 ɹͱ͍͏͔࢓ࣄωλ͸౰વώϛπͰ͢ʂʂʂ

Slide 54

Slide 54 text

ਏ͍ʢਏ͘ͳ͍ʣϥϯΩϯά ໊લ ଧ ਏ͍ʢࡾৼʣ (JBODBSMP 4UBOUPO ӈ +BWJFS#BF[ ӈ 1BVM (PMETDINJEU ӈ +PFZ(BMMP ࠨ 5SFWPS4UPSZ ӈ ໊લ ଧ ਏ͘ͳ͍ ʢ҆ଧʣ +PTF"MUVWF ӈ 5SFWPS4UPSZ ӈ .BSDFMM 0[VOB ӈ 1BVM (PMETDINJEU ӈ ,FWJO1JMMBS ӈ

Slide 55

Slide 55 text

ਏ͞Λ؍࡯ͯ͠ΈΑ͏ ਏ͍…΋ͱ͍ɺεϥΠμʔͰΫϧοΫϧ͢Δ όολʔͷಛ௃ΛΈΜͳͰݟͯΈΑ͏

Slide 56

Slide 56 text

͋ͬʢ࡯͠ʣ 34ຊྥଧ,199ࡾৼͷώϛπ͸ εϥΠμʔʹΑΔࡾৼͩͬͨʢద౰ʣ

Slide 57

Slide 57 text

݁ͼ

Slide 58

Slide 58 text

໺ٿͱٕज़ͷ ʮબٿ؟ʢͤΜ͖Ύ͏͕Μʣʯ 
 ͱ͸ʁ

Slide 59

Slide 59 text

ຖ೔සൟʹൃੜ͢Δ ʮબ୒ͱܾஅʯ …ͷ܁Γฦ͠ͷதͰ ʮબ୒ͱूதʯ ͕͔ͬ͠ΓͰ͖Δ͜ͱ

Slide 60

Slide 60 text

બ୒ͱܾஅ • ΤϯδχΞʹ͸ʮબ୒ʯͱʮܾஅʯ͕ৗʹ͋Δ • DjangoͰ࡞Δ?Flask??ͦΕͱ΋Rails??? • SPAͬͯVue.js͕͍͍ͷʁͦΕͱ΋Angular? • ֮͑ΔͳΒPythonͳͷ͔JavaScript • ৗʹ͘ΔϘʔϧʹରͯ͠ʮৼΔʯ͔ʮৼΒͳ͍ʯ͔
 બ୒͕ഭΒΕΔ໺ٿબखͩͬͯʮબ୒ʯͱʮܾஅʯͷ܁Γฦ͠
 ˞ਏ͍εϥΠμʔ͸ࣺͯΔࣄ΋ඞཁ

Slide 61

Slide 61 text

ਖ਼͘͠ʮબ୒ʯ͢ΔͨΊʹ͸ʁ • Կ͸ͱ΋͋Εʮٕज़ྗʯΛຏ͘͜ͱ • ΤϯδχΞϦϯάΛਖ਼͘͠஌Δɾ࿅श͢Δ • ͓ͦΒ͚ͩ͘Ͳ໺ٿ΋Ұॹ • ೔ʑͷ࿅शɾ஁࿉ΛଵΒͳ͍ • ݸਓษڧɾ࿅श • ֎ͷษڧձ΍Πϕϯτͷ׆༻,νʔϜͰͷ࿅श

Slide 62

Slide 62 text

ʮܾஅʯΛڪΕͳ͍ • ʮΠγϡʔ͔Β͸͡ΊΔʯ • ࡞ΔϞϊɾ෼ੳ͢ΔίτΛʮݴޠԽʯ͢ΔɺԾઆɾςʔϚࠐͰ • ޙड़͢Δʮܾஅ͢Δʯϧʔϧʹͦͷ··ܨ͕Δ • ϞϊΰτΛʮܾஅ͢ΔʯϧʔϧΛࣗ෼ʹ࡞Δ • ʮ໎ͬͨΒ˓˓ʯͷʮ˓˓ʯΛܾΊΔ • ࢲͷ৔߹ɺΤϯδχΞϦϯάͩͱ
 ʮ໎ͬͨΒPythonʯͱ͍͏ϧʔϧΛܾΊ͍ͯΔ • ໺ٿͰݴ͏ͱ͜ΖͷʮϠϚΛுΔʯΈ͍ͨͳϞϊ • ʮܾஅϧʔϧʯͷ֎ʹ͋Δ΋ͷ͸ݟಀ͢ࣄΛڪΕͳ͍ʢεϥΠμʔΛݟૹΔ༻ʹʣ

Slide 63

Slide 63 text

ूத͢Δ • ʮબ୒ʯʮܾஅʯΛਖ਼͘͠ճ͢ʹ͸ʮूதʯ΋େ੾ • ʮબ୒ʯʮܾஅʯͨ͠ࣄΛ΍Γ͖ΔҝͷϦιʔεΛʮूதʯ͢Δ • ৭ʑ͋Ε͜Εͱ΍Γ͗͢ͳ͍ • ྲྀߦΓ΋ͷʹඈͼͭ͘ • ຖ೔ɾຖिͷ༻ʹษڧձ΍Πϕϯτʹߦ͘ • ूத͢Δ͸ͣͷϦιʔεʢ࣌ؒɾ͓ۚʣ͕ൃࢄ͢ΔΑ͏ͳࣄ͸NG • ࣌ؒతʹʮूதʯͰ͖ΔΑ͏ͳʮश׳ʯ࡞ΓʢྫɿSNSઈͪʣ

Slide 64

Slide 64 text

ࢲͷʮ໺ٿ×Pythonʯ͸ऴΘΓ • ʮ໺ٿΛ΍Δͧʂʯͱબ୒ɾܾஅɾूத͓ͨ͠ӄͰ
 ೦ئͷʮ໺ٿΤϯδχΞʯͱͯ͠ࠓ͜͜ʹ͍Δ • εϙʔπͷੈքΛΑΓྑ͘ɺ΋ͬͱ໺ٿΛָ͘͢͠ΔͨΊɺ
 ʮ໺ٿΤϯδχΞͱͯ͠ͷຊۀʹूதʯ • ʮ໺ٿͱΤϯδχΞϦϯάͷֶͼͱϊ΢ϋ΢ʯ
 ͸΋ͬͱ޿͍ੈքʹӋ͹͖ͨ·͢ • ͜Εͦ͜·͞ʹʮͻΖ͕ΔPythonʯ

Slide 65

Slide 65 text

ʮऐ͍͠ʯͱࢥ͏͜ͱͳ͔Ε • ࢲࣗ਎͸ʮ໺ٿҎ֎ͷςʔϚʯͰདྷ೥Ҏ߱ͷ
 PyCon JP΋εϐʔΧʔͱͯ͠௅ઓ͠·͢
 ˠ໺ٿͱ͸ҧ͏ԹΊ͍ͯͨςʔϚΛ΍Γ͍ͨ • ʮ໺ٿ×Pythonʯ͸த઒ͷઐചಛڐͰ͸ͳ͍
 Ή͠Ζ੮͕ۭ͍ͨͷνϟϯεͰ͢Αʁ
 ຊؾͰ໺ٿ޷͖ͳΒ͔͔͍ͬͯ͜΍ʂʂʂ • ͱ͸͍͑ࣗ෼͸ʮ΍͖͏ຽʯͳͷͰςϊώϥΫϧʔ͸͋Γ͑Δ()

Slide 66

Slide 66 text

ࠓ·Ͱ͝੠ԉ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ ϗϯτͷ໺ٿɾεϙʔπͰ ΤϯδχΞͱֵ໋ͯ͠ى͜͢ ͷͰࠓޙ΋ΑΖ͘͠ʂʂ

Slide 67

Slide 67 text

ήʔϜηοτ ໺ٿͱPythonͷ5೥ؒʹײँʂ͋Γ͕ͱ͏͍͟͝·ͨ͠&୭͔࣍ʹଓ͍ͯͶʂ Shinichi Nakagawa(Twitter/Facebook/etc… @shinyorke)