5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

jupyterメモ

Last updated at Posted at 2016-11-12

jupyterのメモです。Macで使用しています。

こちらがバージョンかな?

バージョン
The version of the notebook server is 4.2.1

jupyterの起動

起動
jupyter notebook

jupyterが起動しブラウザからタブが開きます。

ショートカット

使いそうなあたりを確認しました。

ショートカット 動作
ESC コマンドモードになる
y コードモードになる
m マークダウンモードになる
Enter 編集モードになる
(編集モードでは改行)
Ctrl + Enter コードを実行
Shift + Enter コードを実行して、セルを新規追加
a セルを上に新規追加
b セルを下に新規追加
dd セルの削除
c セルのコピー
v セルのペースト
k 上のセルの移動
j 下のセルの移動

vimのショートカットに似ていると思いました(☝ ՞ਊ ՞)

コマンドを実行

コマンドモードで!をつけるとコマンドを実行できます。

コマンドを実行
!使用したいコマンド

以下は実際にコマンドを実行した例です。

コマンド実行例
!pwd
!ls -al /root/notebook

/root/notebook
total 32
drwxr-xr-x  5 root root 4096 Nov 12 08:40 .
dr-xr-x--- 15 root root 4096 Nov 10 15:30 ..
-rw-r--r--  1 root root 1525 Nov 12 08:34 Untitled.ipynb
-rw-r--r--  1 root root 1117 Nov 12 08:35 Untitled1.ipynb

jupyter内で ImportError

jupyter内で、pandasを入れようとしたら,No module エラーががでました。

ImportError: No module named pandas

これは環境(ボクの場合はMac)にpandasが入っていないとjupyterから使用できないようです。
Macにpandasを淹れます。

sudo pip install pandas

今度はImportErrorが消えました。

jupyter 内のセル操作

In などが思うように動作しないときは Kernel から行くのが有用でした。

  • Kernel
    • Restart
    • Restart & Clear Output
    • Restart & Run All
    • Reconnect
5
5
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
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?