👋Hello! Happy new semester!
Welcome to the Big Ideas in Computing and Information lab. This document should familiarize you with JupyterHub and creating and editing Jupyter notebooks, something that you're going to be doing quite a lot of over the course of this semester.
Note: if you are using Anaconda, Don't forget to use the cmpinf0010 environment you created to lauch JupyterLba If you are on JupyterHub then don't worry about ib.
Look to your left. You should see a list of files: this notebook, a
README.md, and maybe a few other files inside a
lab-1 folder. That's the
git repository that you just cloned; if that doesn't quite make sense to you, hang on a few weeks. We'll get there. If you're not there, you may have to navigate to the right folder; its the same as you would using the file browser on your computer.
The following exercises are your lab for this week. In future, you'll usually have a pre-made notebook where you'll fill in your answers in code or Markdown cells. For this week, follow these instructions to create your own notebook!
<your Pitt username>-lab-1.ipynb". (
<your Pitt username>should be your, uh, Pitt username.)
#and text after it) and executing it with Shift-Enter.
By default JupyterHub should autosave your work. To check and make sure you have autosave on, you can go to
settings>autosave documents and ensure that its checked. We still highly recomend you save freqently though! Sometimes the autosave won't occur when you want it! The save icon is the floppy icon.
Double click on this cell. You can edit any cell in a notebook by clicking on it, and then hit Shift-Enter to evaluate the cell.
You can view two notebooks at once (for example, this notebook and your new lab notebook) by clicking and dragging their tab within JupyterLab. Those tabs are directly above the notebook. That can be helpful for reading and following instructions without a lot of tab-switching.
Just for reference, here's that Markdown cheatsheet again.
## Markdown Exercises
During your writing, feel free to use other Markdown styles or test out anything fancy, like writing HTML!
print("Hi! I'm a code cell. Try changing me.")
## Jupyter Notebook Exercises
name = input(prompt="What is your name? ")
print("Hello", name, "!")
%matplotlib inline import pandas as pd # Load the PGH 311 Complaint data data_url = \ "https://data.wprdc.org/datastore/dump/76fda9d0-69be-4dd5-8108-0de7907fc5a4" complaints = pd.read_csv(data_url, parse_dates=True, index_col="CREATED_ON") # Produce a graph that shows the number of complaints per month complaints.resample("M").size().plot();
<your Pitt username>-lab-1.ipynb. (You won't get credit for your hard work otherwise.)
Good job, and see you next week.