Enter | Enter edit mode |
A | Insert cell above |
B | Insert cell below |
D D | Delete selected cell |
Z | Undo cell deletion |
Y | Change to code cell |
M | Change to markdown cell |
R | Change to raw cell |
C | Copy cell |
X | Cut cell |
V | Paste cell below |
Shift + V | Paste cell above |
Shift + M | Merge selected cells |
Up / K | Select cell above |
Down / J | Select cell below |
Shift + Up/Down | Extend selection |
L | Toggle line numbers |
O | Toggle output |
Esc | Enter command mode |
Tab | Code completion |
Shift + Tab | Tooltip/docstring |
Ctrl + ] | Indent |
Ctrl + [ | Dedent |
Ctrl + A | Select all |
Ctrl + Z | Undo |
Ctrl + Y | Redo |
Ctrl + / | Comment/uncomment |
Ctrl + D | Delete line |
Shift + Enter | Run cell, select below |
Ctrl + Enter | Run cell |
Alt + Enter | Run cell, insert below |
Ctrl + Shift + - | Split cell at cursor |
0 0 | Restart kernel |
I I | Interrupt kernel |
%time statement | Time single statement |
%timeit statement | Time with multiple runs |
%who | List variables |
%whos | Detailed variable info |
%reset | Clear all variables |
%pwd | Current directory |
%cd path | Change directory |
%ls | List files |
%history | Command history |
%run script.py | Run Python script |
%load script.py | Load script into cell |
%matplotlib inline | Enable inline plots |
%env VAR=value | Set environment variable |
%pip install package | Install package |
%%time | Time entire cell |
%%timeit | Time cell (multiple runs) |
%%writefile filename | Write cell to file |
%%bash | Run as bash script |
%%html | Render as HTML |
%%javascript | Run JavaScript |
%%latex | Render LaTeX |
%%capture output | Capture output |
%%sql | SQL query (with ipython-sql) |
from IPython.display import display | Import display |
display(obj) | Display object |
display(df.head()) | Display DataFrame |
from IPython.display import HTML | Import HTML |
HTML("<h1>Title</h1>") | Display HTML |
from IPython.display import Image | Import Image |
Image(filename="image.png") | Display image |
from IPython.display import Markdown | Import Markdown |
Markdown("**bold**") | Display Markdown |
import ipywidgets as widgets | Import widgets |
widgets.IntSlider() | Integer slider |
widgets.FloatSlider() | Float slider |
widgets.Dropdown(options=[...]) | Dropdown menu |
widgets.Text() | Text input |
widgets.Button(description="Click") | Button |
widgets.interact(func, x=slider) | Interactive widget |
jupyter labextension list | List extensions |
jupyter labextension install @name | Install extension |
jupyter labextension uninstall @name | Uninstall extension |
jupyter labextension update --all | Update all extensions |
@jupyterlab/toc | Table of contents |
@jupyterlab/git | Git integration |
jupyterlab-lsp | Language Server Protocol |
jupyterlab-execute-time | Cell execution time |
jupyterlab-code-formatter | Code formatting |
jupyter notebook | Start Jupyter Notebook |
jupyter lab | Start JupyterLab |
jupyter notebook --port 8889 | Custom port |
jupyter notebook --no-browser | No auto browser |
jupyter nbconvert --to html notebook.ipynb | Convert to HTML |
jupyter nbconvert --to pdf notebook.ipynb | Convert to PDF |
jupyter nbconvert --to python notebook.ipynb | Convert to Python |
jupyter kernelspec list | List kernels |