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
240
hannari_20191206_goto.pdf
namao510
December 06, 2019
Tweet
Share
Other Decks in Education
See All in Education
Цифровые финансы - магистерская программа Финэка МГИМО 2024 г.
niellony
0
400
Unlocking the Top Marketing Secrets for L&D
tmiket
1
300
Educación digital en la adolescencia
gonz1ale1
0
200
世界の子音探訪記
jamashita
0
240
Visualisation Techniques - Lecture 8 - Information Visualisation (4019538FNR)
signer
PRO
0
1.8k
CULTURA I VALORS
cumclavis
PRO
1
170
【基本】Oracle Database データベース・ユーザー・セキュリティ入門
oracle4engineer
PRO
1
300
week15@tcue2024
nonxxxizm
0
380
2024年度春学期 統計学 第4回 データを「分布」で見る (2024. 5. 2)
akiraasano
PRO
0
140
🎓 ChatGPT を組み込んだ24時間TA : 教育現場における LLM 活用の課題と改善
yasslab
PRO
0
600
week@tcue2024
nonxxxizm
0
360
具体と抽象の行き来を意識する
blendthink
0
290
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
Code Reviewing Like a Champion
maltzj
517
39k
Making Projects Easy
brettharned
111
5.7k
Being A Developer After 40
akosma
72
580k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
662
120k
Learning to Love Humans: Emotional Interface Design
aarron
269
39k
How to train your dragon (web standard)
notwaldorf
79
5.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
224
21k
Side Projects
sachag
451
42k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
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 のアイデアにリストの内容を調整します。