No history yet

Efficiency and Sharing

Work Faster with Shortcuts

Using a mouse to click menus slows you down. To work like a pro, you want to keep your hands on the keyboard. Jupyter has two modes you'll remember from before: Command Mode (blue border) for notebook-level actions, and Edit Mode (green border) for typing inside a cell. Press Esc to enter Command Mode and Enter to enter Edit Mode.

Most of the powerful shortcuts live in Command Mode. Learning a few essential commands will dramatically speed up your workflow.

ActionShortcut (in Command Mode)
Add cell aboveA
Add cell belowB
Delete selected cell(s)D, D (press twice)
Cut selected cell(s)X
Copy selected cell(s)C
Paste cell(s) belowV
Change cell to CodeY
Change cell to MarkdownM
Undo cell deletionZ

Try them out! The best way to learn shortcuts is to stop using the mouse for a few minutes and force yourself to use only the keyboard.

Ensure Your Work Is Reproducible

One of Jupyter's greatest strengths is the ability to run cells out of order. This is great for experimenting, but it can create a mess. You might delete a cell that defined a variable, but that variable still exists in the kernel's memory. When you send the notebook to someone else, their kernel will be fresh, and the code will fail.

Before you share your work, always do a final check by going to Kernel > Restart & Run All. This clears the kernel's memory and runs every cell from top to bottom, exactly as a new user would experience it. If your notebook runs without errors, you can be confident that your logic is sound and shareable.

Sharing Your Story

You've written your code, documented it with Markdown, and verified it runs cleanly. Now it's time to share it. Not everyone has Jupyter installed, so you need a way to export your work into more universal formats.

From the menu, navigate to File > Download as. You'll see several options. The most common are:

  • HTML (.html): This creates a self-contained web page. It's perfect for sharing a static report that can be opened in any web browser.
  • PDF via LaTeX (.pdf): This creates a high-quality, printable document ideal for formal reports or academic papers. Note: This may require installing additional software on your system.

For programmers, the best way to share is often through a service like GitHub, which stores the original .ipynb file. Others can then view it or download it to run the code themselves. There are also web services like nbviewer that can render a notebook directly from a URL.

Lesson image

Organise your cells logically. Use Markdown headers to create sections. Keep code cells short and focused on a single task. Add text cells to explain what you're doing and why. A well-organised notebook tells a clear story and is a gift to your future self and your colleagues.

Let's test your knowledge on making your notebooks efficient and shareable.

Quiz Questions 1/5

You are typing code inside a Jupyter cell and want to switch to Command Mode. Which key should you press?

Quiz Questions 2/5

Why is it a crucial step to use Kernel > Restart & Run All before sharing a notebook?

You now have the core skills to create, document, and share your own data stories. The journey from writing your first line of code to distributing a professional report is complete.