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.5
 入力と出力の履歴
13
を自動的に複数回行う点です。
%%timeit
を使えば複数行の入力を処理できるセル
Magic
コマンド
となります。例えば、
for
ループを使った同等の構成を次に示します。
In [9]: %%timeit
...: L = []
...: for n in range(1000):
...: L.append(n ** 2)
...:
1000 loops, best of 3: 373 µs per loop
ここですぐにわかるのは、リスト内包表記は同等の
for
ループよりも
10
%高速であることです。
「1.9 コードのプロファイリングと実行時間計測」
%timeit
やその他の手段を用いたコードのプ
ロファイリングと実行時間の計測方法について確認します。
1.4.4
Magic
コマンドのヘルプ:
?
%magic
%lsmagic
通常の
Python
関数と同様に
IPython
Magic
コマンドも
docstring
を持っているため、この有益
なドキュメントを標準的な方法で表示できます。例えば、
%timeit
Magic
コマンドのドキュメント
を読むには次のように入力します。
In [10]: %timeit?
その他のコマンドのドキュメントを読む方法も同様です。いくつかの例を含む、利用可能な
Magic
コマンドの一般的な説明を読むには次のように入力します。
In [11]: %magic
利用可能な
Magic
コマンドの単純な一覧を表示するには、次のように入力します。
In [12]: ...
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