Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pandas Series & DataFrames

Total questions: 20

Worksheet time: 12mins

Name
Class
Date
1.

Best way to import the pandas module in your program ?

a)

1.import pandas

b)

2.import pandas as pd

c)

3.from pandas import *

d)

4.All of the above

2.

Which is true for series.

a)

Size is mutable,Values is mutable

b)

size is immutable,values is mutable

c)

size is mutable,values is immutable.

d)

none

3.

Series.tail(3) will return how many values.

a)

3 values from front

b)

3 values from last

c)

5 values

d)

none

4.

Series.head() will return how many rows.

a)

2

b)

3

c)

4

d)

5

5.

To extract subset from Series,the following function is used

a)

row()

b)

column()

c)

loc()

d)

all

6.

we can analyze the data in pandas with :

a)

Series

b)

Dataframe

c)

Both

d)

none

7.

Series in Pandas is

a)

1 Dimensional Array

b)

2 Dimensional array

c)

3 Dimensional array

d)

none of above

8.

Minimum number of argument we require to pass in pandas series ?

a)

0

b)

1

c)

2

d)

3

9.

Series can be created from

a)

Array

b)

Dictionary

c)

Scatter value

d)

All of them

10.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

11.

pandas is a:

a)

Data Structure

b)

Series

c)

Dataframe

d)

Library

12.

Write the output for the following:

import pandas as pd1

s = pd1.Series(5, index=[0, 1, 2, 3])

print(s)

a)

0 5

b)

0 5

1 5

2 5

3 5

dtype: int64

c)

1 5

2 5

2 5

4 5

dtype: int64

d)

0 5

1 5

2 5

3 5

dtype: object

13.

write the output:

import pandas as pd1

s = pd1.Series([1,2,3])

t = pd1.Series([1,2,4])

u=s-t

print (u)

a)

0 1

1 0

2 1

dtype: int64

b)

0 0

1 0

2 1

dtype: int64

c)

0 0

1 0

2 -1

dtype: float64

d)

0 0

1 0

2 -1

dtype: int64

14.

write the output:

import pandas as pd

s=pd.Series([1,2,3,4],index=['a','b','c','d'])

print(s.iloc[2:4])

a)

b 2

c 3

d 4

dtype: int64

b)

b 3

c 4

dtype: int64

c)

c 3

d 4

dtype: int64

d)

none of the above

15.

DataFrame is .......................

a)

size mutable, data mutable

b)

size immutable, data mutable

16.

An empty DataFrame can be created by.................

a)

passing arguments

b)

without passing arguments

17.

Which of the functions can be used to delete column/row from a DataFrame?

a)

pop()

b)

at()

c)

drop()

d)

iloc()

18.

Full form of CSV file is

a)

Comma Separated Vault

b)

Comma Separated Value

c)

Common Separated Value

d)

Common System Value

19.

Dataframe can contain multiple series

a)

True

b)

False

20.

Which is the correct Pandas syntax to read in a csv file and assign it to a DataFrame df?

a)

df = read_csv('file.csv')

b)

df = read('file.csv', type = 'csv')

c)

df = pd.read_csv('file.csv')

d)

df = with open('file.csv') as pd.DataFrame