- Complete the one-minute poll at bit.ly/dsspoll.
- Create a new script called review.py.
-
Create a list called
datasets
with the following names as contents: airport, baseball, calcium, electricbill, and freethrows. Use print statements and references to display the following:- the first item in the list
- the third and fourth items in the list
- the second-to-last item in the list
Create a dictionary called
data_info
for the airport dataset. The dataset's title is US Airport Statistics and it has 135 observations. Use a print statement and reference to display the title of dataset. -
Write a loop that will display each name in
datasets
with the extension .txt on the end. -
Create a function called
add_extensions()
that accepts a list of strings, adds '.txt' to each string in the list, and returns a list of the new strings. Try callingadd_extensions()
withdatasets
as an argument. -
Add a statement to import functions from the
requests
Python library. Use the.get()
method to request the contents of the following webpage: http://ww2.amstat.org/publications/jse/jse_data_archive.htm. Use a print statement to display the HTTP response code for the request.
Click here to download the code for all exercises.