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.2
IPython
のヘルプシステムとドキュメント
5
この仕組みは自分で作ったオブジェクトや関数に対しても働くという点が重要です。
docstring
付きの簡単な関数を定義してみましょう。
In [6]: def square(a):
....: """Return the square of a.""" a
2
乗を返す
....: return a ** 2
....:
自作の関数の
docstring
は、単純に最初の行に文字列リテラルを配置 するだけです。普通、
docstring
の内容は複数行に渡るため、二重引用符を
3
つ続ける記法を慣習的に使います。
それでは
?
を使って関数の
docstring
を表示してみましょう。
In [7]: square?
Type: function
String form: <function square at 0x103713cb0>
Definition: square(a)
Docs
tring: Return the square of a. a
2
乗を返す
docstring
を介してドキュメントへ迅速にアクセスできることが、自分の書いたコードにこのよ
うなドキュメントを埋め込む習慣を付ける理由の
1
つです。
1.2.2
??
文字を使ったソースコードの探索
Python
言語は、読みやすさを重視しているため、興味のあるオブジェクトのソースコードから
洞察を得ることもしばしばあります。
IPython
はソースコードを表示する
2
つのクエスチョンマー
ク(
??
)によるショートカットを提供しています。 ...
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