Lecture Note
University
University of California San DiegoCourse
DSC 207R | Python for Data SciencePages
2
Academic year
2023
anon
Views
18
Live Code, Getting Started Getting started with the notebook dashboard The dashboard is the page that is displayed to you right away. The folder from which you began Jupyter Notebook is listed on this page. You can navigate your file system using thedashboard in the same way that you would with any other file explorer interface. It is crucialto remember that the Jupyter notebook server is now executing on this file system. Evenanother computer could be the server. You will see a different UI if your laptop's server is notset to localhost. At this point, we want to remind you to follow along if you haven't already started doing it. We know one of the biggest obstacles to success in online classes is getting started workingwith the infrastructure and your learning environment. So we really want you to do this withus. We are just going to get our first notebook started, run some initial code, and add somedocumentation. It shouldn't take you much time, but it will get you up and running. If you getset up now, for the rest of the course, you'll be able to follow along in notebooks with thematerial we present and play around with the code yourself. Creating a new notebook Click the "New" button in the dashboard's upper right corner to start a new notebook. Choose "Python 3" as your Python version in this box. Once you have done this, you will beprovided with a new notebook. To give it a name, click "Untitled" at the top. We'll call it "IntroNotebook" in this instance. So we gave our notebook a new name. Returning to ourdashboard, we can see that a new notebook file with the name "Intro Notebook.ipynb" hasbeen added; this is the new notebook we just created and renamed. In the beginning, there's sometimes some confusion as both the notebook application and the notebook are called notebook, but they are separate. The notebook application is a webapplication that creates the interface in the browser and executes Python and otherlanguages' code. The notebook file is a file format with the .ipynb extension that saves code,images, and text in a single document, making it easy to share. As we said before, thisfeature has gained lots of popularity in data science. You presumably already know this, but your browser's "Intro Notebook" notepad is in a different tab. You can have multiple open notebooks open at once. Any new notebook youopen will be in a new tab like this. Getting started with coding Now let's get started with coding using the code cells. Hopefully, you're following along, but please feel free to pause the video and try each step we show you if you fall behind. It is
normal to take some time in the beginning, so don't worry if it's causing some confusion attimes. We will now click on the first cell. Simply click the mouse in the rectangular cell in the notebook and type Python code. For example, you can write print("Hello World!"), which isour traditional greeting in any computer science programming course. This code can therefore be executed in a variety of ways. One method is to select "Run" from the toolbar up top. You should simply obtain the outcome that was written, which is"Hello World," as seen here. Alternatively, you can click and hold that cell.
Getting Started
Please or to post comments