199k views
3 votes
What do the %history and %rerun commands do?

User Stiliyan
by
8.9k points

1 Answer

6 votes

Final answer:

The %history command in Jupyter Notebook lists past entered commands for review, while the %rerun command allows re-execution of selected commands from history.

Step-by-step explanation:

The %history command in Jupyter Notebook provides a list of the past commands you've entered. This can be especially useful if you need to review or repeat prior computations or code snippets. The %history command has various options to filter and format the output, allowing you to see a certain range of your command history, for example.

The %rerun command, on the other hand, allows you to re-execute commands from your history. You can rerun a single line or a range of lines by providing the relevant line numbers. This is particularly helpful if you want to re-execute a previous command or set of commands without having to retype them.

The %rerun command is used to re-execute a range of commands from the command history. It allows you to specify a range of line numbers and execute the corresponding commands again. This can save time when re-running a series of commands without having to manually type them again.

User Tomab
by
8.2k points