Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 1.39 KB

File metadata and controls

25 lines (16 loc) · 1.39 KB

From simple loops and conditionals to working with data files

Overview:

Today we'll review the basics of Python control and extend simple loops, conditionals, and functions to working with simple data files.

Readings:

Chapters 8-11 of Think Python (don't worry, the chapters are only like 8 pages long)

Class Session:

Run through the IPython notebook.

Exercise:

  1. Download the rents_full.csv file and save it to your working directory. Create a new, clean IPython notebook to contain your homework.
  2. Using the techniques we learned in class on 9/21:
    1. Calculate the mean, minimum, and maximum rent price
    2. Calculate the mean, minimum, and maximum number of bedrooms
    3. Calculate the mean, minimum, and maximum square footage
    4. Replace any spaces, commas, or forward slashes in neighborhood names with underscores, and convert the neighborhood name to uppercase letters. Create a list containing each cleaned name, 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.