Skip to Content
Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
book

Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

by Jake VanderPlas, 菊池 彰
May 2018
Intermediate to advanced
556 pages
13h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
1.9
 コードのプロファイリングと実行時間計測
29
Line # Hits Time Per Hit % Time Line Contents
==============================================================
1 def sum_of_lists(N):
2 1 2 2.0 0.0 total = 0
3 6 8 1.3 0.1 for i in range(5):
4 5 9001 1800.2 95.9
L = [j ^ (j >> i) ...
5 5 371 74.2 4.0 total += sum(L)
6 1 0 0.0 0.0 return total
最上部の情報は、結果を読み取るための鍵となります。時間はマイクロ秒単位で報告され、プロ
グラムが最も時間を費やしている場所を確認できます。この情報を使用してスクリプトの内容を修
正し、使い方に適したパフォーマンスを発揮できるようにします。
%lprun
および使用可能なオプションの詳細については、
IPython
ヘルプ機能を使用してください
IPython
プロンプトで
%lprun?
と入力します)。
1.9.4
 メモリ使用のプロファイリング:
%memit
%mprun
プロファイリングのもう
1
つの側面は、コードが使用するメモリ量です。これは別の
IPython
ジュール
memory_profiler
を使って測定できます。
line_profiler
と同様に、
pip
を使ってイ
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9784873118413Other