Answered step by step
Verified Expert Solution
Link Copied!

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 )

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions