![]() If you are planning to share your Notebook with others, you will probably want to clear the output first so that the next person can run the cells themselves. The other handy feature in this menu is the ability to clear a cell’s output. You can also go here to change a cell’s type, although I personally find the toolbar to be more intuitive for that. The Cell menu allows you to run one cell, a group of cells, or all the cells. The Insert menu is just for inserting cells above or below the currently selected cell. This is also where you would go if you want to mess about with the cell’s toolbar. You can also toggle Line Numbers within cells on or off. The View menu is useful for toggling the visibility of the header and toolbar. If you see a greyed out menu item, try changing the cell’s type and see if the item becomes available to use. For example, a code cell cannot have an image inserted into it, but a Markdown cell can. The reason for this is that they do not apply to the currently selected cell. Note that some of the items in this menu are greyed out. This is also where you would go if you wanted to delete, split, or merge a cell. This allows you to create checkpoints that you can roll back to if you need to. I think the most interesting menu item is the Save and Checkpoint option. This is also where you would go to rename a Notebook. In it, you can create a new Notebook or open a preexisting one. This article won’t go into detail for every single option in every menu, but it will focus on the items that are unique to the Notebook application. The menu runs along the top of the Notebook just like menus do in other applications. The Jupyter Notebook has several menus that you can use to interact with your Notebook. ![]() For example, if you open a fresh Notebook and run the first cell at the top of the Notebook, the square braces will fill with the number 1. The square braces will auto fill with a number that indicates the order that you ran the cells. When you run a cell, you will notice that there are some square braces next to the word In to the left of the cell. This makes it easy to separate out your code into logical chunks without needing to reimport libraries or recreate variables or functions in every cell. If you have multiple cells in your Notebook, and you run the cells in order, you can share your variables and imports across cells. When I ran the code above, the output looked like this: If you prefer using your keyboard, you can just press Shift + Enter. To execute a cell, you can just select the cell and click the Run button that is in the row of buttons along the top. Running a cell means that you will execute the cell’s contents. You should now see an in-browser dialog titled Rename Notebook. Just move your mouse over the word Untitled and click on the text. Since that isn’t a very descriptive name, let’s change it! This is the title for the page and the name of your Notebook. You will notice that at the top of the page is the word Untitled. Your web page should now look like this: Naming For simplicity’s sake, let’s choose Python 3. On my machine, I happen to have Python 2 and Python 3 installed, so I can create a Notebook that uses either of these. Now that you know how to start a Notebook server, you should probably learn how to create an actual Notebook document.Īll you need to do is click on the New button (upper right), and it will open up a list of choices. Let’s actually create a Notebook now! Creating a Notebook Note that right now you are not actually running a Notebook, but instead you are just running the Notebook server. This will start up Jupyter and your default browser should start (or open a new tab) to the following URL: Your browser should now look something like this:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |