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
290
hannari_20191206_goto.pdf
namao510
December 06, 2019
Tweet
Share
Other Decks in Education
See All in Education
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.4k
DIP_3_Frequency
hachama
0
140
相互コミュニケーションの難しさ
masakiokuda
0
290
今までのやり方でやってみよう!?~今までのやり方でやってみよう!?~
kanamitsu
0
200
社外コミュニティの歩き方
masakiokuda
2
220
Adobe Express
matleenalaakso
1
8k
20250830_MIEE祭_会社員視点での学びのヒント
ponponmikankan
1
180
Présentation_1ère_Spé_2025.pdf
bernhardsvt
0
420
XML and Related Technologies - Lecture 7 - Web Technologies (1019888BNR)
signer
PRO
0
3k
生成AIとの付き合い方 / Generative AI and us
kaityo256
PRO
11
2k
ROSConJP 2025 発表スライド
f0reacharr
0
250
Alumnote inc. Company Deck
yukinumata
0
5k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
33k
We Have a Design System, Now What?
morganepeng
53
7.9k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Code Review Best Practice
trishagee
72
19k
How to train your dragon (web standard)
notwaldorf
97
6.3k
Unsuck your backbone
ammeep
671
58k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Embracing the Ebb and Flow
colly
88
4.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Building Applications with DynamoDB
mza
96
6.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
650
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 のアイデアにリストの内容を調整します。