LoginSignup
12
6

More than 5 years have passed since last update.

Jupyterの小技5

Last updated at Posted at 2017-05-18

Jupyterの(マイナーな)マジックコマンド紹介

Jupyterの小技4 - Qiitaの続き

%precision : 表示桁数設定

  • 使用法1 %precision : デフォルトの設定を表示
  • 使用法2 %precision 3 : 小数点以下3桁表示に設定
  • 使用法3 %precision %08.3f : 小数点以下3桁、全体で8桁、頭を0で埋めるように設定

%bookmark, %cd, %pwd: ディレクトリ操作

使用例

c:\temp を workingdir(名称は任意可) ディレクトリとして登録

jupyter
%bookmark workingdir c:\temp

登録済み一覧表示

jupyter
%bookmark -l
>>>
Current bookmarks:
workingdir -> c:\temp

カレントディレクトリ表示

jupyter
%pwd
>>>
'C:\\Users\\tsutomu\\Documents'

登録したディレクトリに移動

jupyter
%cd workingdir
>>>
(bookmark:workingdir) -> c:\temp
c:\temp

元のディレクトリに戻る

jupyter
%cd -
>>>
C:\Users\tsutomu\Documents

ブックマーク削除

jupyter
%bookmark -d workingdir

全ブックマーク削除

jupyter
%bookmark -r

参考

Built-in magic commands — IPython 3.2.1 documentation

以上

12
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
6