Question: QUESTION 1 This code from the Polling case study poll_path = 'http://projects.fivethirtyeight.com/general-model/' filename = 'president_general_polls_2016.csv' from urllib import request request.urlretrieve(poll_path+filename, filename=filename) polls = pd.read_csv(filename )


QUESTION 1 This code from the Polling case study poll_path = 'http://projects.fivethirtyeight.com/general-model/' filename = 'president_general_polls_2016.csv' from urllib import request request.urlretrieve(poll_path+filename, filename=filename) polls = pd.read_csv(filename ) a. downloads a file from a website to disk and then imports it into a DataFrame b. imports a file from a website directly into a DataFrame c. retrieves a file from a website and imports it into a DataFrame d. downloads a file from a website into a request module and imports it into a DataFrame QUESTION 2 This code from the Polling case study polls.select_dtypes('object').head() date_cols = ['startdate','enddate'] polls[date_cols] = polls[date_cols].apply(pd.to_datetime) a. displays the columns with the object data type and converts one of them to the datetime data type b. selects the columns with the object data type and converts one of them to the datetime data type c. selects the columns with the object data type and converts two of them to the datetime data type d. displays the columns with the object data type and converts two of them to the datetime data type
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
