Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Frame and Series 3

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

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

2.

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

a)

3 values from front

b)

3 values from last

c)

5 values

d)

none

3.

To extract subset from Series,the following function is used

a)

row()

b)

column()

c)

loc()

d)

all

4.

we can analyze the data in pandas with :

a)

Series

b)

Dataframe

c)

Both

d)

none

5.

Series in Pandas is

a)

1 Dimensional Array

b)

2 Dimensional array

c)

3 Dimensional array

d)

none of above

6.

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

a)

0

b)

1

c)

2

d)

3

7.

Series can be created from

a)

Array

b)

Dictionary

c)

Scatter value

d)

All of them

8.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

9.

pandas is a:

a)

Data Structure

b)

Series

c)

Dataframe

d)

Library

10.

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

11.

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

12.

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

13.

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

a)

size mutable, data mutable

b)

size immutable, data mutable

14.

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

a)

pop()

b)

at()

c)

drop()

d)

iloc()

15.

Dataframe can contain multiple series

a)

True

b)

False

16.

Which of the following statements are valid to create a empty series ?

a)

s1=pd.Series(0)

b)

s1=pd.Series()

c)

s1=pd.Series(NaN)

d)

s1=pd.Series(' ')

17.

To get the number of bytes of the Series Data, ___________________ attribute is used.

a)

index

b)

size

c)

itemsize

d)

ndim

18.

To get the number of dimensions of a Series object, ____________ attribute is displayed

a)

itemsize

b)

size

c)

index

d)

ndim

19.

Sruti wants to create a Series with data 10, 20 , 30. She is confused from the choice given below:

a)

s= pd.Series ( [ 10, 20, 30 ] )

b)

s= pd.Series ( [ 10, 20, 30 ] , [ 0, 1, 2 ] )

c)

s= pd.Series ( index= [ 0, 1, 2 ] , data = [ 10, 20, 30 ] )

d)

All of the above

20.

Write the output of the following?

import pandas as pd

s=pd.Series( [ 10,20,30,40,50] ,index=[1,2,3,4,5])

print ( s [ [ 1, 5, 3 ] ] )

a)

Prints rows with index 1 , 5 and 3

b)

Prints rows at position 1, 5 and 3

c)

Prints rows with data 1,5, 3

d)

Error