Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Dataframe

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

2.

Data structures in Pandas can be mutated in the terms of ____ but not of _____.

a)

size, value

b)

value, size

c)

semantic, size

d)

none of the above

3.

pandas is a:

a)

Data Structure

b)

Series

c)

Dataframe

d)

Library

4.

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

5.

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

6.

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

7.

write the output:

import pandas as pd

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

print(s.loc['b':'d'])

a)

b 2

c 3

d 4

dtype: float64

b)

b 2

c 3

d 4

dtype: object

c)

c 3

d 4

dtype: int64

d)

b 2

c 3

d 4

dtype: int64

8.

In data science, which of the python library are more popular ?

a)

numpy

b)

pandas

c)

django

d)

none

9.

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

a)

3 values from front

b)

3 values from last

c)

5 values

d)

none

10.

Series.head() will return how many rows.

a)

2

b)

4

c)

3

d)

5

11.

Which among the following options can be used to create a DataFrame in Pandas?

a)

A scalar value

b)

An ndarray

c)

A python dict

d)

All of the above

12.

Which of the following commands is used to convert array named "grades" into data frame named "df_grades"?

a)

df_grades = grades

b)

df_grades = pd.DataFrame(grades)

c)

df_grades = pd.DataFrame("grades")

d)

grades = pd.DataFrame(df_grades)