Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Select all that apply: Suppose you want to create a pandas DataFrame. Which of the following can be the input of pd.read_csv ? a.

1. Select all that apply:

Suppose you want to create a pandas DataFrame. Which of the following can be the input of pd.read_csv?

a. Path to a comma-separated (CSV) file saved on your local computer

b. A Jupyter Notebook

c. Python dictionary-like object

d. URL to a CSV file stored in a publicly accessible Internet domain

e. Path to an Excel (XLSX) file saved on your local computer

2. Select one or more answers that apply:

Suppose you have created a pandas DataFrame in your workspace, and you would like to export it with method .to_csv(). Your DataFrame has names for columns and names (indices) for rows. You do want to keep them in your exported CSV file. Which of the parameters of to_csv() must you specify manually?

a. The exact column name representing the index (row names)

b. Whether there should be an index (row names)

c. Path to save the file

d. Whether there should be a header (row names)

e. The exact column name representing the header (colum names)

3. Select all that apply:

You are reading a CSV file with the following columns:

date

customer_count

customer_residential_state

using the following command:

data = pd.read_csv("my-data.csv") 

Which of the following should be used to obtain the field "date"?

a. data.index

b. data["DATE"]

c. data.Date

d. data.columns

e. data["Date"]

f. data.DATE

g. data["date"]

h. data.date

4.

Select all that apply:

Suppose you want to transpose a pandas DataFrame. That is, you want the rows to be columns and vice versa. Which of the following command(s) could you use?

df is a pandas dataframe.

a. df.T()

b. df.T

c. df.transpose()

d. transpose(df)

e. df.transpose

f. t(df)

g. T(df)

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_2

Step: 3

blur-text-image_3

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Prepare a short profile of Lucy Clifford ?

Answered: 1 week ago

Question

Prepare a short profile of Rosa parks?

Answered: 1 week ago

Question

Prepare a short profile of victor marie hugo ?

Answered: 1 week ago