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
hannari_20191206_goto.pdf
Search
namao510
December 06, 2019
Education
0
280
hannari_20191206_goto.pdf
namao510
December 06, 2019
Tweet
Share
Other Decks in Education
See All in Education
データで見る赤ちゃんの成長
syuchimu
0
280
Linuxのよく使うコマンドを解説
mickey_kubo
1
270
2025年度春学期 統計学 第15回 分布についての仮説を検証する ー 仮説検定(2) (2025. 7. 17)
akiraasano
PRO
0
110
仮説の取扱説明書/User_Guide_to_a_Hypothesis
florets1
4
380
【品女100周年企画】Pitch Deck
shinagawajoshigakuin_100th
0
6k
JPCERTから始まる草の根活動~セキュリティ文化醸成のためのアクション~
masakiokuda
0
220
GitHubとAzureを使って開発者になろう
ymd65536
1
160
H5P-työkalut
matleenalaakso
4
40k
DIP_1_Introduction
hachama
0
120
(キラキラ)人事教育担当のつらみ~教育担当として知っておくポイント~
masakiokuda
0
140
令和政経義塾第2期説明会
nxji
0
200
Master of Applied Science & Engineering: Computer Science & Master of Science in Applied Informatics: Artificial Intelligence and Data Science
signer
PRO
0
770
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Documentation Writing (for coders)
carmenintech
74
5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Transcript
みんなのはんなりPythonの会 2019/12/06 ~環境構築 & コード作成~ @namao
みんなのはんなりPythonの会 2019/12/06 自己紹介 @namao Python歴:2年弱 業務利用(データ分析) 興味のあるIT技術
(Python以外) Go, Linux(Debian),セキュリティなど 後輩などにPython指導する機会↗ connpass
みんなのはんなりPythonの会 2019/12/06 概要 私の指導経験 業務中での後輩指導 業務外での親友への指導(タダ!)
みんなのはんなりPythonの会 2019/12/06 概要 学習(つまずき)ポイント 環境構築 →AnacondaによるPython3.8環境構築 コードの書き方 →速いコード(pandas)作成
私の指導経験 業務中での後輩指導 業務外での親友への指導(タダ!)
みんなのはんなりPythonの会 2019/12/06
みんなのはんなりPythonの会 2019/12/06 コン パイ ル 不要 必要 イン ス トー
ル元 Anaconda独自 Python公式 Anaconda vs pip https://www.anaconda.com/understanding-conda-and-pip/ コンパイル: テキストからバイナリに変換 (初心者には難) 青字:メリット
みんなのはんなりPythonの会 2019/12/06 コン パイ ル 不要 必要 イン ス トー
ル元 Anaconda独自 Python公式 Anaconda vs pip https://www.anaconda.com/understanding-conda-and-pip/ 青字:メリット Windowsユーザーには、Anacondaがおすすめ!
みんなのはんなりPythonの会 2019/12/06 パッケージ情報を知る コマンド: conda search (パッケージ名) –c (チャンネル名)
*動作環境: cmd (windows) コンパイル情報 ・ ・ ・ Pythonのversion AnacondaのPython version対応状況を把握可
みんなのはんなりPythonの会 2019/12/06 仮想環境作成 仮想環境イメージ コマンド: conda create -n (仮想環境名)
python=(version番号) (パッケージ名) –c (チャンネル名) 実行例 *動作環境: cmd (windows)
みんなのはんなりPythonの会 2019/12/06 仮想環境作成 仮想環境イメージ コマンド: conda create -n (仮想環境名)
python=(version番号) (パッケージ名) –c (チャンネル名) 実行例 *動作環境: cmd (windows) 2コマンドで 環境構築可能
みんなのはんなりPythonの会 2019/12/06 Jupyter notebook エラー解消 (windows) asyncio.pyに上記コードを追加
みんなのはんなりPythonの会 2019/12/06 Python以外のパッケージ1 (R) https://anaconda.org/conda-forge/r-essentials Jupyter上でのR
みんなのはんなりPythonの会 2019/12/06 Python以外のパッケージ2 (git, git-bash) https://anaconda.org/anaconda/git Windowsでの bash(Linux)環境候補として Git-bashもおすすめ https://anaconda.org/conda-forge/git-bash
git git-bash
みんなのはんなりPythonの会 2019/12/06
みんなのはんなりPythonの会 2019/12/06 少休止(人もコードも?) 世間では・・・ 生産性向上 (スピード)
みんなのはんなりPythonの会 2019/12/06 少休止(人もコードも?) 世間では・・・ 生産性向上 (スピード) コードも同じ!
みんなのはんなりPythonの会 2019/12/06 速いコードの書き方(一般論) Python(スクリプト言語)の速さはコード行数に比例 forループを減らすことが基本 N=10**4 a=[] for
i in range(N): if i%3==0: a.append(i) N=10**4 a=[i for i in range(N) if i%3==0] ☓ ◯
みんなのはんなりPythonの会 2019/12/06 コードのスピード測定 (jupyter noebook) Jupyterでは%%timeitというマジックコマンドを使うのが簡単! https://ipython.readthedocs.io/en/stable/interactive/magics.html#cell-magics ☓ ◯
みんなのはんなりPythonの会 2019/12/06 処理のイメージ図 コードの速度比較(例1:ファイル結合) ☓ 10000 生徒一人の3教科の点数
みんなのはんなりPythonの会 2019/12/06 処理のイメージ図 コードの速度比較(例1:ファイル結合) ① ②
みんなのはんなりPythonの会 2019/12/06 処理のイメージ図 コードの速度比較(例1:ファイル結合) ① ②
みんなのはんなりPythonの会 2019/12/06 コードの速度比較(例2:行毎の合計) 10000人の学生それぞれの 3教科の合計点を算出 10000 Eng, Math, Japan sum
処理のイメージ図
みんなのはんなりPythonの会 2019/12/06 コード例 (10000人の3教科の合計) ① data.apply(sum,axis=1) ② data['Eng']+data['Math']+data['Japan’] ③ data.eval('Eng+Math+Japan’)
④ data.sum(axis=1) ⑤ pd.Series(data.values.sum(axis=1)) 10000 Eng, Math, Japan sum 処理のイメージ図 コードの速度比較(例2:行毎の合計)
みんなのはんなりPythonの会 2019/12/06 コード例 (10000人の3教科の合計) ① data.apply(sum,axis=1) ② data['Eng']+data['Math']+data['Japan’] ③ data.eval('Eng+Math+Japan’)
④ data.sum(axis=1) ⑤ pd.Series(data.values.sum(axis=1)) 速度結果 ①1160 ms,②2.58 ms,③9.96 ms,④2.05 ms,⑤1.14 ms 10000 Eng, Math, Japan sum 処理のイメージ図 コードの速度比較(例2:行毎の合計)
みんなのはんなりPythonの会 2019/12/06 本日のまとめ 環境構築 Anaconda活用方法(python3.8環境をコマンドで作成) Python以外のパッケージ(例: R, git)もインストール可
コードの書き方 速さを意識したコードを書くことは重要 スピード測定には、%%timeitが便利 (jupyter notebook)
みんなのはんなりPythonの会 2019/12/06
みんなのはんなりPythonの会 2019/12/06 まとめ アイデアを確認します。 上位の候補に投票して集約します。 要件と制限を確認します。
上位 5 から 10 のアイデアにリストの内容を調整します。