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
IMU-00 Pi
kanaya
0
360
SARA Annual Report 2024-25
sara2023
1
180
ふりかえり研修2025
pokotyamu
0
1.1k
Tutorial: Foundations of Blind Source Separation and Its Advances in Spatial Self-Supervised Learning
yoshipon
1
110
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
1.7k
Interaction - Lecture 10 - Information Visualisation (4019538FNR)
signer
PRO
0
2k
仮説の取扱説明書/User_Guide_to_a_Hypothesis
florets1
4
300
『会社を知ってもらう』から『安心して活躍してもらう』までの プロセスとフロー
sasakendayo
0
230
i-GIP 2025 中高生のみなさんへ資料
202200
0
480
America and the World
oripsolob
0
510
Gamified Interventions for Composting Behavior: A Case Study Using the Gamiflow Framework in a Workplace Setting
ezefranca
1
120
2025.05.10 技術書とVoicyとわたし #RPALT
kaitou
1
210
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
Designing Experiences People Love
moore
142
24k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
RailsConf 2023
tenderlove
30
1.1k
Fireside Chat
paigeccino
37
3.5k
Rails Girls Zürich Keynote
gr2m
94
14k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The Language of Interfaces
destraynor
158
25k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
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 のアイデアにリストの内容を調整します。