wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2021 SAMPLE PAPER 1 (TERM 1)

Total questions: 55

Worksheet time: 28mins

Name
Class
Date
1.

To create an empty Series object, you can use:

a)

pd.Series(empty)

b)

pd.Series( )

c)

pd.Series(np.NaN)

d)

all of these

2.

To specify datatype int16 for a Series object, you can write :

a)

pd.Series(data = array, dtype = int16)

b)

pd.Series(data = array, dtype = numpy.int16)

c)

pd.Series(data = array.dtype pandas.int16)

d)

all of the above

3.

To get the number of dimensions of a Series object,

a)

index

b)

size attribute is displayed.

c)

itemsize

d)

ndim

4.

To get the size of the datatype of the items in Series object, you can display attribute.

a)

index

b)

size

c)

itemsize

d)

ndim

5.

To get the number of elements in a Series object, attribute may be used.

a)

index

b)

size

c)

itemsize

d)

ndim

6.

To get the number of bytes of the Series data, attribute is displayed.

a)

hasnans

b)

nbytes

c)

ndim

d)

dtype

7.

To check if the Series object contains NaN values, attribute is displayed.

a)

hasnans

b)

nbytes

c)

ndim

d)

dtype

8.

To display third element of a Series object S, you will write

a)

S[:3]

b)

S[2]

c)

S[3]

d)

S[:2]

9.

To display first three elements of a Series object S, you may write

a)

S[:3]

b)

S[3]

c)

S[3rd]

d)

all of these

10.

To display last five rows of a Series object S, you may write

a)

head()

b)

head(5)

c)

tail( )

d)

tail(5)

e)

both c and d

11.

Pandas object cannot grow in size.

a)

DataFrane

b)

Panel

c)

Series

d)

None of the above

12.

Given a Pandas series called Sequences, the command which will display the first 4 rows is

a)

print(Sequences.head(4))

b)

print(Sequences.Head (4))

c)

print(Sequences.heads(4))

d)

print(Sequences.Heads (4))

13.

If a Dataframe is created using a 2D dictionary, then the indexes/row labels are formed from

a)

dictionary's values

b)

inner dictionary's keys

c)

outer dictionary's keys

d)

none of these

14.

If a dataframe is created using a 2D dictionary, then the column labels are formed from

a)

dictionary's values

b)

inner dictionary's keys

c)

outer dictionary's keys

d)

none of these

15.

The axis 0 identifies a dataframe's

a)

rows

b)

columns

c)

values

d)

datatype

16.

The axis 1 identifies a dataframe's

a)

rows

b)

columns

c)

values

d)

datatype

17.

To get the number of elements in a dataframe,

a)

size

b)

shape

c)

values

d)

ndim

18.

To get a number representing number of axes in a dataframe, used. attribute may be

a)

size

b)

shape

c)

ndim

d)

values

19.

To display the 3rd, 4th and 5th columns from the 6th to 9th rows of a dataframe you can write

a)

DF.loc[6:9, 3:5]

b)

DF.loc[6:10, 3:6]

c)

DF.iloc[6:10, 3:6]

d)

DF.iloc[6:9, 3:5]

20.

To change the 5th column's value at 3rd row as 35 in dataframe DF, you can write

a)

DF[4, 6] = 35

b)

DF.iat[4, 6] = 35

c)

DF[3, 5] = 35

d)

DF.iat[3, 5] = 35

21.

Which among the following options can be used to create a DataFrame in Pandas ?

a)

A scalar value

b)

An ndarray

c)

A python dict

d)

All of these

22.

Identify the correct statement:

a)

Data frames can change their size.

b)

Series act in a way similar to that of an array.

c)

Both (a) and b)

d)

None of the above

23.

To delete a column from a DataFrame, you may use statement.

a)

remove

b)

del

c)

drop

d)

cancel

e)

both b and c

24.

To delete a row from a DataFrame, you may use

a)

remove

b)

del

c)

drop

d)

cancel

25.

To iterate over horizontal subsets of dataframe,

a)

iterate()

b)

iterrows()

c)

itercolss()

d)

iteritems()

26.

To iterate over vertical subsets of a dataframe, function may be used.

a)

iterate()

b)

iterrows()

c)

itercols()

d)

iteritems()

27.

To add two dataframes' values,

a)

plus function may be used.

b)

rplus

c)

add

d)

radd

e)

both c and d

28.

To subtract the values of two dataframes,

a)

sub

b)

difference

c)

rsub

d)

both a and c

e)

minus

29.

To divide the values of two dataframes, function may be used. function may be used.

a)

divide and /

b)

div and rdiv

c)

division and %

d)

/ and %

30.

To get the 3 bottommost rows from a dataframe, you may use

a)

bottom()

b)

bottom(3)

c)

tail()

d)

tail(3)

31.

Which of the following arguments lets you specify index labels of dataframe through Dataframe( ) ?

a)

index

b)

label

c)

columns

d)

all of the above

32.

To get top 5 rows of a dataframe, you may use

a)

head()

b)

head(5)

c)

both a and b

d)

none of the above

33.

Which of the following can be used to specify data for creating a Dataframe ?

a)

Series

b)

DataFrame

c)

Structured ndarray

d)

all of these

34.

All Pandas' data structures are mutable but not always mutable

a)

size, value

b)

semantic, size

c)

value, size

d)

none of these

35.

Which of the following statement will import Pandas library ?

a)

import pandas as pd

b)

import pandas as py

c)

from pandas import *

d)

all of these

36.

. What will be the output for the following code ?

import pandas as pd

S = pd. Series([1,2,3,4,5],index = ['a', 'b', 'c', 'd', 'e'])

print ( s[ 'a'] )

a)

2

b)

1

c)

3

d)

4

37.

What will be the output for the following code ?

import pandas as pd

import numpy as np

S = pd.Series (np.random.randn(2))

print (s.size)

a)

0

b)

1

c)

2

d)

3

38.

What will be the output for the following code ?

import pandas as pd

import numpy as np

S= pd.Series(np.random.randn(4))

print (s.ndim)

a)

0

b)

1

c)

2

d)

3

39.

What is the purpose of using ndim attribute ?

a)

It returns the number of elements in the given data structure

b)

It returns the Series object in the form of an ndarray

c)

It returns a list of the indexes / labels.

d)

It returns the number of dimensions of the given data structure

40.

PyPlot is an interface of Python's.

a)

seaborn

b)

plotly library.

c)

ggplot

d)

matplotlib

41.

For 2D plotting using a Python library, which library interface is often used ,

a)

seaborn

b)

plotly

c)

matplotlib

d)

matplotlib.pyplot

42.

Which of the following is not a valid chart type ?

a)

Statistical

b)

Box

c)

Pie

d)

Line

43.

Which of the following is not a valid plotting function of pyplot ?

a)

pie()

b)

plot()

c)

bar()

d)

line()

44.

Which of the following plotting functions does not plot multiple data series ?

a)

plot()

b)

barh()

c)

bar()

d)

pie()

45.

The plot which tells the trend between two graphed variables is the

a)

scatter

b)

bar

c)

line

d)

pie

46.

Which of the following functions is used to create a line chart ?

a)

line()

b)

chart()

c)

plot()

d)

plotline()

47.

Which of the following function will produce a bar chart ?

a)

plotbar()

b)

plot()

c)

bar()

d)

barh()

48.

Which of the following function will create a vertical bar chart ?

a)

plot()

b)

bar()

c)

plotbar()

d)

barh()

49.

Which of the following function will create a horizontal bar chart ?

a)

plot()

b)

bar()

c)

barh()

d)

plotbarh()

50.

The data points plotted on a graph are called

a)

point

b)

pointers

c)

marks

d)

markers

51.

A connected by straight line segments.

a)

line

b)

bar

c)

pie

d)

boxplot

52.

Which argument of bar() lets you set the thickness of bar ?

a)

thick

b)

thickness

c)

width

d)

barwidth

53.

Which function lets you set the title of the plot ?

a)

title()

b)

graphtitle()

c)

plottitle()

d)

all of these

54.

The command used to give a heading to a graph is

a)

plt.show()

b)

plt.plot()

c)

plt.xlabel( )

d)

plt.title( )

55.

Which function would you use to set the limits for x-axis of the plot?

a)

limits()

b)

xlimits()

c)

xlim()

d)

lim()