Exercise 5: working with data files
- Due Sep 27, 2017 by 12:30pm
- Points 20
- Submitting a file upload
- File Types ipynb and pdf
Exercise 5: from loops and conditionals to working with data files and QGIS
Download rents_full.csv Download rents_full.csv and save it to your working directory.
Part 1:
Create a new, clean Jupyter notebook to contain your homework submission.
Using the techniques we learned up to and including class on 9/18 and 9/20. Use functions to encapsulate your logic. Include docstrings in those functions for documentation.
- Calculate the mean, minimum, and maximum rent price
- Calculate the mean, minimum, and maximum number of bedrooms
- Calculate the mean, minimum, and maximum square footage
- Replace any spaces, commas, or forward slashes in neighborhood names with underscores, and convert the neighborhood name to uppercase letters. Create a list containing unique cleaned names, then print the first 15 elements in this list.
Round all of your mean values to 2 decimal places. Use comments to document all of your logic throughout the notebook. Make sure your entire notebook runs properly and without any errors. Click Kernel > Restart > Clear all outputs and restart. This clears your memory and re-initializes your notebook. Then click Cell > Run all and make sure everything behaves properly. Then submit your .ipynb file via bcourses.
Part 2:
Load the rents_full.csv Download rents_full.csv file into QGIS and use bacground layers to generate an attractive map showing the distribution of rents for one bedroom units in the Bay Area. Include a legend and title, following the guidelines in the QGIS tutorial through part 5. Export it as a pdf and upload the pdf.