Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started