Upgrade to Pro — share decks privately, control downloads, hide ads and more …

33分4秒ではじめるPy “Baseball” Data入門

33分4秒ではじめるPy “Baseball” Data入門

#PyNyumon #4 2017/2/20 LT登壇資料

すべてのPython初心者&野球好きに贈る

2c0947c6a28e7f771ebd9859ecf54e5c?s=128

Shinichi Nakagawa

February 20, 2017
Tweet

Transcript

  1. 33෼4ඵͰ͸͡ΊΔ Py “Baseball” Dataೖ໳ Shinichi Nakagawa @shinyorke (໺ٿPythonͷਓ)

  2. Who am I ? • Shinichi Nakagawa(@shinyorke) • Retty. Inc

    Engineer/Tech Lead • Python/PyData/Baseball Science/Agile • ໺ٿͷਓʮ໺ٿʯʮPythonʯͰݕࡧʂ • Ͳ͜ͷνʔϜͷϑΝϯ͔͸࡯͍ͯͩ͘͠͞
  3. ͜ΕΛॻ͍ͨਓͰ͢(࣮࿩) ॳ৺ऀ͕PythonΛ֮͑ΔҝͷຊͷબͼํΛମܥԽͯ͠Έͨ(2017൛) http://shinyorke.hatenablog.com/entry/2017/01/15/170602

  4. Starting member • PyData #ͱ͸ • Py Baseball Data #ͱ͸

    • 33෼4ඵ(ఔ౓)ͰͰ͖ΔPy “Baseball” Data • ·ͱΊ
  5. PyData #ͱ͸

  6. “”” PyDataͱ͸σʔλ෼ੳ΍σʔλ׆༻ ʹPythonͳΒͼʹPython Library Λ ར༻͠Α͏ͱ͍͏ਓྨͷӦΈͷ૯শ “”” ※@iktakahiro ͞Μͷ͓ݴ༿ΑΓൈਮ http://www.slideshare.net/

    iktakahiro/pydata-67913897
  7. PyDataɹ˞ݸਓతͳղऍͱݟղ • ਓྨ͕࢒ͨ͠,΋͘͠͸͜Ε͔Β࢒͢σʔλΛ,Pythonͷ
 ΤίγεςϜͰ෼ੳ&(ϚτϞʹ)׆༻͠Α͏ʂͱ͍͏ӦΈ. • PyDataͷ݁Ռ,Πϊϕʔγϣϯ͕ى͖ͨΓؔΘΔਓୡ͕
 ޾ͤʹͳͬͨΒ͍͍ͳ. • Excelͷ୅ΘΓʹPython, ΨνͷػցֶशɾDeep

    Learning, ໺ٿσʔλΛָ͍ͬͯ͡͠Ήetc…શ෦PyDataͩΑʂ
  8. Py Baseball Data #ͱ͸

  9. “”” Py Baseball Dataͱ͸, ໺ٿ౷ܭֶٴͼ,ͳΜJͳωλ࡞ΓͷͨΊ,
 PythonͳΒͼʹPython Library Λ
 ར༻͠Α͏ͱ͍͏,
 ʮ΍͖͏ຽ(໺ٿϑΝϯ)ʯͷӦΈͷ૯শ

    “”” ※ࢲ(@shinyorke)͕࡞ͬͨ଄ޠ
  10. ࣄྫ ʲॳ৺ऀ޲͚ʳ33෼4ඵͰ͓΅͑Δ໺ٿ౷ܭֶͱPyDataʙཅଲ߯Λఴ͑ͯ http://qiita.com/shinyorke/items/ee58a82ad589f7f4c446

  11. ࠓ೔΍Δ͜ͱ • Python 3(3.6.0)͕ಈ͘؀ڥΛ࡞Δ • PyData؀ڥΛ࡞Δ&ಈ͔͢ • WBC೔ຊ୅දࡔຊ༐ਓ(G)ͷ੒੷Λ࣋ͬͯ͘Δ #࡯͠ •

    લॲཧͱՄࢹԽ,ηΠόʔϝτϦΫεΛ΍ͬͯΈΔ • ॴཁ࣌ؒɿ33෼4ඵ #ͳΜͰ΍ࡕਆؔ܎ͳ͍΍Ζ • https://github.com/Shinichi-Nakagawa/pynyumon_baseball/blob/ master/hayato_sakamoto.ipynb
  12. Python 3(3.6.0)؀ڥΛ࡞Δ ~ ᐅ # Mac OS X(macOS)ͷ৔߹Ͱ͢,ଞͷOS͸্ख͘άά͍ͬͯͩ͘͞. ~ ᐅ

    brew install python3 ~ ᐅ python3 -m venv ~/Document/yakiu # venvͰ؀ڥ࡞Δ(Path͸Ͳ͜Ͱ΋) ~ ᐅ source ~/Documents/yakiu/bin/activate # Ծ૝؀ڥΛ༗ޮԽ͢ΔΑ
  13. PyData؀ڥΛ࡞Δ&ಈ͔͢ $ # Mac OS X(macOS)ͷ৔߹Ͱ͢,ଞͷOS͸্ख͘άά͍ͬͯͩ͘͞. (yakiu) ~ ᐅ pip

    install ipython pandas beautifulsoup4 numpy lxml html5lib jupyter matplotlib seaborn (yakiu) ~ ᐅ jupyter notebook
  14. ଓ͖͸ͪ͜ΒͰ(ࢼͯ͠Έͯ) https://github.com/Shinichi-Nakagawa/pynyumon_baseball/ blob/master/hayato_sakamoto.ipynb

  15. ·ͱΊ • ͦΒ(Python͸Data؀ڥ࡞Γָ͕Ͱ)
 ͦ͏(ࡔຊ༐ਓ͸ϝνϟΫνϟੌ͍ʹ)
 Αɹ(ܾ·͍ͬͯΔ͡Όͳ͍͔) • ໺ٿ޷͖ͳΒ,PyData͸໺ٿ͔Βೖͬͨ΄͏͕΍Γ΍͍͢ͱ ࢥ͍·͢ʂ(ݸਓͷݟղ) • ໺ٿʹݶΒͣ,޷͖ͳςʔϚɾ೤தͰ͖ΔϞϊͰγϯϓϧʹ

    ͸͡ΊΔͷ͕ྑ͍ͱࢥ͏Αʂ #ଃΔݴ༿
  16. ήʔϜηοτʂʂʂ ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠. Shinichi Nakagawa(Twitter/Facebook:@shinyorke)