Search Header Logo

Quiz 10

Authored by Mohand Mahmoud

Computers

University

Used 1+ times

Quiz 10
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

what is output:

import pandas as pd

mydataset = {

'cars': ["BMW", "Volvo", "Ford"],

'passings': [3, 7, 2]

}

myvar = pd.DataFrame(mydataset)

print(myvar)

  cars  passings
0    BMW         3
1  Volvo         7
2   Ford         2
  cars  passings
    BMW         3
  Volvo         7
   Ford         2
0    1
1    7
2    2
dtype: int64

ERORR

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

How to make Empty DataFrame ???

import pandas
myvar = pandas.DataFrame()

print(myvar)

import pandas
myvar = pandas.DataFrame.empty()

print(myvar)

import pandas
print(pandas.DataFrame.empty())

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a)

print(myvar) what is output ??

0    1
1    7
2    2
dtype: int64
  cars  passings
0    BMW         3
1  Volvo         7
2   Ford         2
cars  passings
   BMW         3
  Volvo         7
   Ford         2

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a)

print(myvar[1])

1

7

2

NAN

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a, index = ["x", "y", "z"])

print(myvar["y"])

y

"y"

1

Non of them

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

import pandas as pd

calories = {"day1": 420, "day2": 380, "day3": 390}

myvar = pd.Series(calories, index = ["day1", "day2"])

print(myvar)

what is output????

day1    420
day2    380
dtype: int64
0      420
1      380
dtype: int64
  420   day1    
  380    day2    
dtype: int64

Non of them

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

what is output : import pandas as pd

data = {

"calories": [420, 380, 390],

"duration": [50, 40, 45]

}

myvar = pd.DataFrame(data)

print(myvar)

Error

420     50
380      40
390      45
dtype: int64
50      420
40      380
45      390
dtype: int64
   calories  duration
0       420        50
1       380        40
2       390        45

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?