Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pandas-Series

Total questions: 15

Worksheet time: 8mins

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.

Series in Pandas is

a)

1 Dimensional Array

b)

2 Dimensional array

c)

3 Dimensional array

d)

none of above

4.

Which is not a feature of series

a)

Homogeneous data

b)

Immutable size

c)

Mutable data

d)

Multiple rows

5.

Series can be created from

a)

Array

b)

Dictionary

c)

Scatter value

d)

All of them

6.

Which package should be needed for series

a)

Maths

b)

Statistic

c)

Pandas

d)

Random

7.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

8.

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

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.

Give the output of the following code:


>>>import pandas as pd

>>>dict1 = {'AR' : 100, 'VR' : 200, 'AI' : 300}

>>>ser = pd.Series(dict1)

>>>print(ser[1])

a)

AR

b)

100

c)

VR

d)

200

14.

Let us suppose ser is a series. What will be the print statement to display last 3 elements?

a)

print(ser.head(3))

b)

print(ser.tail(3))

c)

print(ser.head())

d)

print(ser.tail())

15.

What will be the print statement to display the elements of a series series1 from end till beginning in step 2?

a)

print(series1[::-2])

b)

print(series1[::2])

c)

print(series1[:-2:])

d)

print(series1[:2:])