Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CBSE Old Questions on Pandas

Total questions: 8

Worksheet time: 14mins

Name
Class
Date
1.

A Series is a one dimensional array containing a sequence of values of any data type (int, float, list, string, etc), having by default have ________ data labels.

a)

alphanumeric

b)

string

c)

decimal

d)

numeric

2.

Find the output of the following code: import pandas as pd lst1=[20,35,40] ser1=pd.Series([20,35,40]) print(lst1+lst1) print(ser1+ser1)

4 lines
3.

Complete the given Python code to get the required output as "California": import_____________as pd data={'Yosemite':'California','Yellowstone':'Wyoming', 'Glacier':'Montana','RockyMountain':'Colorado'} national_parks=pd.Series(_____________) print(national_parks _________)

4 lines
4.

Which of the following command will show the last 3 rows from a Pandas Series named NP?

a)

NP.Tail( )

b)

NP.tail(3)

c)

NP.TAIL(3)

d)

All of the above

5.

In Python Pandas, while performing mathematical operations on series, index matching is implemented and all missing values are filled in with _____by default.

a)

Null

b)

Blank

c)

NaN

d)

Zero

6.

Assertion (A):- To use the Pandas library in a Python program, one must import it. Reasoning (R): - The only alias name that can be used with the Pandas library is pd.

a)

Both A and R are true and R is the correct explanation for A

b)

Both A and R are true and R is not the correct explanation for A

c)

A is True but R is False

d)

A is false but R is True

7.

Predict the output of the given Python code: import pandas as pd list1=[-10,-20,-30] ser = pd.Series(list1*2) print(ser)

4 lines
8.

Complete the given Python code to get the required output as: Rajasthan import _________ as pd di = {'Corbett': 'Uttarakhand', 'Sariska': 'Rajasthan', 'Kanha': 'Madhya Pradesh', 'Gir':'Gujarat'} NP = ___________. Series ( _____ ) print(NP[ ___________ ])

4 lines