Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
9.6. Saving and Exporting Notebooks
Interactive Audio Lesson
Unlock the classroom podcast
The transcript is above and free to read. A free account plays the conversation back.
Create a free accountToday, we're going to learn how to save our Jupyter Notebooks. What do you think happens if you don't save your work?
You might lose everything if the computer crashes!
Exactly! To save your notebook, you can use the shortcut Ctrl + S. Can anyone tell me what the .ipynb extension stands for?
Is it 'Interactive Python Notebook'?
Close! It stands for 'IPython Notebook', which was the original name. Great job! Let's summarize: Save often with Ctrl + S to avoid losing your work.
Unlock the classroom podcast
The transcript is above and free to read. A free account plays the conversation back.
Create a free accountNow, let's talk about exporting your notebooks. Why do you think we would want to export a notebook?
So we can share it with others, right?
Exactly! You can export your notebook by going to File > Download as. What formats are available?
I think you can download it as HTML and PDF!
And also as a Python file!
Perfect! Using these formats allows you to share your notebooks easily by choosing the format best suited for your audience.
Overview
Medium Summary
Key concepts include saving notebooks using shortcuts and exporting them in formats like HTML, PDF, and Python (.py). Understanding these operations enhances collaboration and sharing of Jupyter work.
Detailed Summary
Saving and Exporting Notebooks
In this section, the processes of saving and exporting Jupyter Notebooks are covered. Jupyter Notebooks are saved with a .ipynb extension, which allows users to preserve their work. The saving process can be done using the shortcut Ctrl + S or by clicking the Save icon.
Additionally, users have the option to export their notebooks in various formats via the menu option File > Download as. The available formats include HTML for web sharing, PDF for print-friendly versions, and Python (.py) for code sharing. This capability is essential for collaborating with peers or submitting work in different formats suited for specific audiences.
Audio Book
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free account-
Jupyter Notebooks are saved with a .ipynb extension.
-
To Save:
- Use Ctrl + S or click the Save icon.
Detailed Explanation
This chunk explains how to save your Jupyter notebooks, which are the files you work on within Jupyter. The notebooks have a specific file extension, .ipynb, which stands for 'interactive Python notebook'. Saving your work is crucial to avoid losing any progress. You can save your notebook quickly by using the keyboard shortcut Ctrl + S, which works in many software applications. Alternatively, you can click on the Save icon located in the Jupyter toolbar to perform the same action. Both methods ensure your changes are stored and can be accessed later.
Examples & Analogies
Imagine you are writing a long essay on your computer. Just like you would hit 'Save' frequently to avoid losing your work, saving a Jupyter notebook regularly prevents any loss of code or notes. Each time you make significant changes, it’s a good habit to save it, ensuring all your ideas are preserved.
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free account- To Export:
- Go to File > Download as > HTML / PDF / Python (.py)
This allows you to share your notebooks in different formats.
Detailed Explanation
This section discusses how to export your Jupyter notebooks to different file formats, which is useful for sharing your work with others or for creating reports. You can export your notebook by navigating to the menu: click on 'File', then 'Download as'. You have several options, including exporting as HTML, PDF, or a plain Python script (.py). Exporting to HTML or PDF is beneficial if you want to create a document that others can read without needing Jupyter, while exporting to .py is useful for sharing the code in a format that can be used in other Python environments.
Examples & Analogies
Think of exporting your Jupyter notebook like packing your school project for a presentation. You might want to print it out (like exporting to PDF), share it electronically with classmates (like exporting to HTML), or just keep the raw materials (like exporting to a .py file for coding). Each format serves a unique purpose, just like how you might prepare your project for different audiences.
--
Key Concepts
Core takeaways and short definitions to help you quickly recall the key ideas from this section.
.ipynb: The extension for Jupyter Notebook files, indicating their format.
Saving: The key process of preserving notebook changes using shortcuts.
Exporting: The ability to share notebooks by converting them into other formats.
Examples
Memory Aids
Interactive tools to help you remember key concepts