wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pandas Series-1

Total questions: 21

Worksheet time: 11mins

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.head() will return how many rows.

a)

2

b)

3

c)

4

d)

5

4.

To extract subset from Series,the following function is used

a)

row()

b)

column()

c)

loc()

d)

all

5.

we can analyze the data in pandas with :

a)

Series

b)

Dataframe

c)

Both

d)

none

6.

Series in Pandas is

a)

1 Dimensional Array

b)

2 Dimensional array

c)

3 Dimensional array

d)

none of above

7.

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

a)

0

b)

1

c)

2

d)

3

8.

Which is not a feature of series

a)

Homogeneous data

b)

Immutable size

c)

Mutable data

d)

Multiple rows

9.

Series can be created from

a)

Array

b)

Dictionary

c)

Scatter value

d)

All of them

10.

Which package should be needed for series

a)

Maths

b)

Statistic

c)

Pandas

d)

Random

11.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

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.

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

16.

Pandas is_________.

a)

a Python library that is built on NumPy and provides easy-to-use data structures and data analysis tools for the Python programming language.

b)

a Python 2D plotting library which produces publication-quality figures in a variety of hardcopy formats and interactive environments across platforms.

c)

a Python library that implements a range of machine learning,

preprocessing, cross-validation and visualization algorithms using a unified interface.

17.

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

18.
a)

print(ser[2,4])

b)

print(ser[[2:4]])

c)

print(ser[[2,4]])

d)

print(ser[2,3,4])

19.

Which of the following commands is used to install Pandas?

a)

pip install python-pandas

b)

pip install pandas

c)

python install python

d)

python install pandas

20.

a)

print(ser[[1,3]])

b)

print(ser[1:3])

c)

print(ser[[1:3]])

d)

print(ser[1,3])

21.

Have you enjoyed the quiz on Pandas Series?

a)

Yes

b)

No