Homework for Day 1
Here is a csv file with a list of US States, and the latitudes and longitudes of the state’s centers. StateAndLocDataDay1.csv
Instructions:
- Download the csv file from the link above.
- Open up an empty Jupyter notebook. (Go here, click “Try Classic Notebook”, wait for page to load, then go to “File”, “New Notebook”, “Python 3”
- In your empty notebook, go to “File”, then “Open”. This will take you to a new page with a directory of all files in your Binder. Select the “Upload” button in the right corner.
- Upload the csv file. It is now in your directory, and you can import data from it.
- Here’s the actual homework!
- Open the csv file and examine what’s in it. What variable types are in here? Strings, floats, or integers?
- In your empty Jupyter notebook, write a script that imports the data from the file and makes a scatter plot. (Note: you’ll have to make all longitudes negative.)
- Your scatter plot should look vaguely like the outline of the US. Make sure Alaska is in the right place! If it’s not, make sure you are plotting the correct x and y values.
- That’s it! Congratulations, you finished your first Python assignment!