Search Header Logo

Quiz 5.1

Authored by Mohand Mahmoud

Computers

Professional Development

Used 1+ times

Quiz 5.1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is output:

import pandas as pd

mydataset = {

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

'passings': [3, 7, 2]

}

myvar = pd.DataFrame(mydataset)

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

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to make Empty DataFrame ???

import pandas
myvar = pandas.DataFrame()

print(myvar)

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

import pandas
myvar = pandas.DataFrame.empty()

print(myvar)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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
  car   passings 
 BMW       3
 Volvo     7
Ford      2
cars  passings
0    BMW         3
1  Volvo         7
2   Ford         2

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a)

print(myvar[1])


1

2

NAN

all choisies is wrong

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import pandas as pd

a = [1, 7, 2]

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

print(myvar["y"])


y

"y"

NAN

all choisies is wrong

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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 • 1 pt

what is output :

import pandas as pd

data = {

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

"duration": [50, 40, 45]

}

#load data into a DataFrame object:

df = pd.DataFrame(data)

print(df.loc[0])



calories 380 duration 40 Name: 0, dtype: int64


calories 390 duration 45 Name: 0, dtype: int64

calories    420
duration     50
Name: 0, dtype: int64


calories 420 duration 50 Name: 0, dtype: dataframe

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?