Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1.Suppose you are given a df data frame. df = pd.DataFrame ({'Click_Id': ['A', 'B', 'C', 'D', 'E'], 'Count': [100,200,300,400,250]}) Now you want to change the

Q1.Suppose you are given a df data frame.

df = pd.DataFrame ({'Click_Id': ['A', 'B', 'C', 'D', 'E'], 'Count': [100,200,300,400,250]})

Now you want to change the column name "Count " in df to

" Click_Count ". So, you wrote the following code to accomplish this step.

df.rename (columns = {'Count': 'Click_Count'})

What will be the result of the printout below? print df.columns

(CHOOSE RIGHT ANSWER)

  1. ['Click_Id', 'Click_Count']
  2. ['Click_Id', 'Count']
  3. Print Error
  4. None of the above

Q2.Consider the function fun, which is defined below:

def fun (x):

x [0] = 5

return x

There is a list with three numbers.

g = [10,11,12]

Which of the following will be the output of this print statement:

print fun (g), g

(CHOOSE RIGHT ANSWER)

  1. [5, 11, 12] [5, 11, 12]
  2. [5, 11, 12] [10, 11, 12]
  3. [10, 11, 12] [10, 11, 12]
  4. [10, 11, 12] [5, 11, 12]

Q3.Suppose you are given two lists:

a = [1,2,3,4,5]

b = [6,7,8,9]

The challenge is to create a list containing all the elements a and b in one dimension.

(CHOOSE RIGHT ANSWER)

  1. a.append (b)
  2. a.extend (b)
  3. Any of the above
  4. None of the above

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

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago