Useful Jupyter Notebook Shortcuts and Tips
View Python Function Documentation
Press Shift + Tab inside the parentheses of a function to view its docstring and signature.
Execute the Current Cell
Shift + Enter: Run the current cell and select the next cellCtrl + Enter: Run the current cell and stayAlt + Enter: Run the current cell and insert a new cell below
Plot Graphs Inline
import matplotlib.pyplot as plt
%matplotlib inline
Execute Shell Commands
Prefix with ! to run shell commands directly from a cell:
!pip install gensim
Additional Tips
- Autocomplete: Press
Tabto autocomplete variable and function names. - Interrupt Execution: Press the stop button or use
Kernel > Interrupt. - Restart Kernel: Use
Kernel > Restartto reset the Python environment. - Markdown Cells: Use Markdown for formatted text, headers, lists, and code blocks.
- Magic Commands: Use
%timeit,%lsmagic,%who, etc., for enhanced functionality.