Skip to the content.
Magic Commands for Jupyter Notebook
- %%ai magic command to specify a model chat with the model using a natural language prompt
- %%latex helps you to display LaTeX code in Jupyter Notebook
- %%sql can run any SQL query with %sql(line magic) and %%sql(cell magic) commands
- %run runs a Python file in a notebook becomes easy. If you have a python file, for example demo .py and want to run it within the notebook, you can do it with this command
%run demo .py
- %%writefile creates a new file app .py with the entire content present in the cell.
%%writefile app .py
- %history -n to display all the previous commands.
-n
will help you get the last n commands.