LoginSignup
0
3

More than 3 years have passed since last update.

python jupyter notebook へのスニペット設定

Posted at

スニペットとは

  • 使用頻度の高いコード、定型的なクラス宣言等を、簡単に入力できるようにしたもの。
  • 単純な入力や、ループ作業がごく少ない入力で済むため効率的。
  • Extensionとして提携のものを導入する、自分で作成するの2パターンがある

※ ちなみに。

スニペットとは、一般的には「切れ端」「断片」という意味の英語である。 IT用語としては、プログラミング言語の中で簡単に切り貼りして再利用できる部分のこと。


ターミナルで拡張機能のDL、インストール

1. コマンドプロンプト等で拡張機能をダウンロード

pip
pip install jupyter_contrib_nbextensions

2. 上記DLが成功したら、以下のコードで拡張機能をインストール

jupyter contrib nbextension install --user

3. Jupyter notebookの起動(再起動)

jupyter notebook

4.Nbextensionsタブの設定

デフォルトでは以下のチェックがついているが、これを解除する。

disable configuration for nbextensions without explicit compatibility
(they may break your notebook environment, but can be useful to show for nbextension development)

Extensonの設定で以下を選択する。

  • Nbextensions dashboard tab(必須;Extensionsのタブ表示)
  • Snippets (オリジナルのスニペット作成・活用可能)
  • Snippets Menu(スニペットを利用)
  • ExecuteTime(セルごとの実行時間を表示)

参考URL

@_snow_narcissusさんのエントリ;オリジナルスニペットの登録方法も説明されている

よちよちpythonさんのエントリ

0
3
0

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
0
3