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.7
 シェルに関連する
Magic
コマンド
19
これは
Python
のリストとよく似ていますが、
grep
fields
メソッド、
s
n
p
プロパティなど
の追加機能があり、検索、フィルタリング、および結果の表示で有用です。これらの詳細について
は、
IPython
の組み込みヘルプを参照してください。
逆方向(つまり
Python
変数をシェルに渡す)は、
{varname}
構文を使います。
In [9]: message = "hello from Python"
In [10]: !echo {message}
hello from Python
Python
の変数名を波カッコ(
{
)の中に置くと、その変数の値がシェルコマンドに渡ります。
1.7
 シェルに関連する
Magic
コマンド
IPython
からシェルコマンドを使うと、ファイルシステムを移動するのに
!cd
コマンドが使えな
いことに気付くでしょう。
In [11]: !pwd
/home/jake/projects/myproject
In [12]: !cd ..
In [13]: !pwd
/home/jake/projects/myproject
IPython
から実行されるシェルコマンドが、一時的なサブシェルで実行されるのが原因です。作
業ディレクトリを永続的に変更する場合は、
%cd
Magic
コマンドを使います。
In [14]: %cd ..
/home/jake/projects
実際には、
%
記号なしでも実行可能です。
In [15]: cd myproject ...
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