wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Series1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the default data type of a Series in Pandas?

a)

int64

b)

float64

c)

object

d)

number

2.

Which of the following is/are parameters of Series() function?

a)

index

b)

data

c)

copy

d)

all of above

3.

Predict output of the following code.

import pandas as pd

s=pd.Series([22,33,44,55,66]

print(s.loc[3:4])

a)

44

b)

55

c)

66

d)

Error

4.

Series.head() will return how many rows.

a)

2

b)

3

c)

4

d)

5

5.

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

a)

0

b)

1

c)

2

d)

3

6.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

7.

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

8.

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

9.

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

10.

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