Slide 1

Slide 1 text

JupyterNotebookͰͷdebugೖ໳ pdb, ipdb, %debugͱ͔ fkubota

Slide 2

Slide 2 text

2 ࣗݾ঺հ fkubota (Twitter, Kaggle) - όϯυϧΧʔυͷձࣾ(ΧϯϜ)ͰػցֶशΤϯδχΞ - Kaggle Expert - ԭೄग़਎(౦ژʹग़͖ͯͯ3೥൒) - ෺ཧֶՊग़਎(ڧ૬ؔిࢠܥɺ4.2KͷӷମϔϦ΢Ϝʹ࣓ੑମಥͬࠐΜͰͨ) - ϓϩάϥϛϯάྺ͸2೥൒͙Β͍ - झຯ - ૣى͖(4࣌൒ىচ) - Kaggle - ίʔώʔɺϏʔϧɺ΢ΟεΩʔ - ಡॻɺ෺ཧɺ఩ֶ

Slide 3

Slide 3 text

3 Contents debug ʹ͍ͭͯ JupyterNotebookͰ debug ʹೖ໳ ͳͥσόοΨ͕ඞཁ͔ͱ ͔ɻ ෼ੳίϯϖͰඞͣͱߦͬͯ ͍͍΄Ͳ࢖͏ JupyterNotebookͰͷdebug ํ๏ʹ͍ͭͯ؆୯ʹ঺հɻ ओʹϏΪφʔʹ޲͚ͯʂ

Slide 4

Slide 4 text

4 ͋Δ͋Δʁ ίϯϖ΍ͬͨΔͰʔʂ ͜ͷϊʔτϒοΫͰೖ໳͠Α͏ɻ ͏ʔʔʔΜɻ ਓͷίʔυಡΉͷ͠ΜͲ͍ɻ ࣗ෼ͷ؀ڥͩͱಈ͔ͳ͍ͷͰमਖ਼͕ඞཁɻ ͽ͑Μ͑ͯ͜ͺ͓Μɻ*1 *1 ࠓ͞Βฉ͚ͳ͍ʮͽ͑Μʯͱʮͺ͓Μʯͷ࢖͍ํ debugྗߴΊΕ͹ ͠ΜͲܰ͞ݮ͞ΕΔ͔΋ʁ

Slide 5

Slide 5 text

5 ͜Μͳܦݧͳ͍Ͱ͔͢ʁ outputFͷ஋Λ֬ೝ͍ͨ͠ɻ outputF͸input_ʹґଘ͍ͯͯ͠ɺ input_͸outputCʹґଘ͍ͯͯ͠ɺ outputC͸funcCͷhogeʹґଘ͍ͯͯ͠ɺ hoge͸funcBʹґଘ͍ͯͯ͠..........(T T) ਂ͗͢Δʂ

Slide 6

Slide 6 text

6 ͱΓ͋͑ͣ͜͏͢ΔΑͶ print debug ʂʂ

Slide 7

Slide 7 text

7 େม print debug ΋ѱ͘ͳ͍͠ɺ๻΋Α͘࢖͏ΜͰ͕͢ɺinput_ Λม͑ͨͱ͖ ͷ outputF ͷڍಈΛ֬ೝ͍ͨ͠ͱ͖ͳΜ͔ΊͪΌͪ͘ΌେมͰ͢ΑͶɻ ͦ΋ͦ΋ɺfuncB ͔Β funcF ʹ౸ୡ͢Δ·Ͱʹ਺෼͔͔ΔͱͳΔͱ࣌ؒ ΋͔͔ͬͯ͠·͏ɻ

Slide 8

Slide 8 text

8 ͔͔࣌ؒΔ Α͘Θ͔ΒΜ͔Β plotͯ͠ΈΔ͔ɻ ͔ͦͬoutputF͸ೋ ࣍ݩ͔ͩΒΤϥʔ ͰͪΌ͏ͳɻ ͱΓ͋͑ͣ γΣΠϓ֬ೝɻ 30 sec 30 sec 30 sec funcD ʹ౸ୡ͢Δ·Ͱʹ͕͔͔࣌ؒͬͯ͠·͏...

Slide 9

Slide 9 text

9 σόοΨ࢖͏ͱָͩΑ pdb, ipdb, IDE, %debug, etc...

Slide 10

Slide 10 text

10 .py ͱ .ipynb ෼ੳίϯϖ͸ɺ ϊʔτϒοΫ(.ipynb)Ͱೖ໳͢Δਓ͕ଟ͍ & ࢀߟࢿྉ͕গͳ͍ ͷͰϊʔτϒοΫܗࣜͰ࿩ਐΊ·͢ .ipynb JupyterNotebook, JupyterLab, Kaggle, Colab, etc... .py

Slide 11

Slide 11 text

11 ͲΕ͕͍͍ʁ(202108࣌఺) pdb %debug ipdb pudb xeus-python JupyterNotebook ˕ ˕ ̋ ˚ ˚ JupyterLab ˕ ˕ ̋ ˚ ˚ KaggleNotebook ˕ ˕ ̋ ʁ ʁ Colaboratory ˕ ˕ ̋ ʁ ʁ ߴػೳ ˕: Πϯετʔϧෆཁ ̋: Πϯετʔϧඞཁ(؆୯) ˚: Πϯετʔϧඞཁ(ͪΐͬͱΊΜͲ͍͘͞) ʁ: ಈ͔ͨ͜͠ͱͳ͍ Ұ෦Λ঺հ

Slide 12

Slide 12 text

12 ಈֶ͔ͤͯ΂Δαϯϓϧ pdbͱ%debugֶ͕΂Δαϯϓϧ࡞Γ·ͨ͠ʂ https://colab.research.google.com/drive/ 1di0EBQ5FaGME82JOLDP0kjaerk1fqakk?usp=shari ng 3ਓͷํʹ ςετϢʔβͱͯ͠ ڠྗͯ͠΋Β͍·ͨ͠ @natsumin_0813 @tnot_fount @chi1234s

Slide 13

Slide 13 text

Thanks :)