wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CT QUIZ 2

Total questions: 75

Worksheet time: 42mins

Name
Class
Date
1.

Best way to import the pandas module in your program ?

a)

1.import pandas

b)

2.import pandas as pd

c)

3.from pandas import *

d)

4.All of the above

2.

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

3.

Series.tail(3) will return how many values.

a)

3 values from front

b)

3 values from last

c)

5 values

d)

none

4.

Series.head() will return how many rows.

a)

2

b)

3

c)

4

d)

5

5.

To extract subset from Series,the following function is used

a)

row()

b)

column()

c)

loc()

d)

all

6.

we can analyze the data in pandas with :

a)

Series

b)

Dataframe

c)

Both

d)

none

7.

Series in Pandas is

a)

1 Dimensional Array

b)

2 Dimensional array

c)

3 Dimensional array

d)

none of above

8.

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

a)

0

b)

1

c)

2

d)

3

9.

Series can be created from

a)

Array

b)

Dictionary

c)

Scatter value

d)

All of them

10.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

11.

pandas is a:

a)

Data Structure

b)

Series

c)

Dataframe

d)

Library

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.

DataFrame is .......................

a)

size mutable, data mutable

b)

size immutable, data mutable

16.

An empty DataFrame can be created by.................

a)

passing arguments

b)

without passing arguments

17.

Which of the functions can be used to delete column/row from a DataFrame?

a)

pop()

b)

at()

c)

drop()

d)

iloc()

18.

Full form of CSV file is

a)

Comma Separated Vault

b)

Comma Separated Value

c)

Common Separated Value

d)

Common System Value

19.

Dataframe can contain multiple series

a)

True

b)

False

20.

Which is the correct Pandas syntax to read in a csv file and assign it to a DataFrame df?

a)

df = read_csv('file.csv')

b)

df = read('file.csv', type = 'csv')

c)

df = pd.read_csv('file.csv')

d)

df = with open('file.csv') as pd.DataFrame

21.

Which of the following is used to load an excel file to python environment?

a)

pd.read_csv('fileName.csv')

b)

pd.read_csv('fileName.xls')

c)

pd.read_excel('fileName.xls')

d)

None of the mentioned

22.

Which among the following is present in NumPy?

a)

List

b)

Series

c)

Dataframes

d)

None of these

23.

matplotlib library is built over

a)

NumPy

b)

Pandas

c)

Seaborn

d)

None of the mentioned

24.

The keyword used to check the dimension of an array is

a)

ndim

b)

dim

c)

dimension

d)

ndimension

25.

Which among the following is present in Pandas?

a)

Series

b)

Dataframes

c)

None of the mentioned

d)

Both the mentioned

26.

The keyword used to find the null values is

a)

isna()

b)

isnull()

c)

Both the mentioned

d)

None of the mentioned

27.

The common notation used for Pandas is

a)

ns

b)

pd

c)

np

d)

sns

28.

The common notation used for matplotlib.pyplot is

a)

plt

b)

mat

c)

np

d)

sns

29.

The common notation used for seaborn is

a)

ns

b)

pd

c)

np

d)

sns

30.

Data Frames is

a)

One Dimensional

b)

Two Dimensional

c)

Three Dimensional

d)

None of the above

31.

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

print(s[:3] gives ?

a)

a 1

b 2

c 3

b)

a 1

b 2

c 3

d 4

c)

a 3

b 4

c 5

32.

series = pd.series(55)

print(series) gives ?

a)

0 51

1 52

2 53

3 54

4 55

b)

1 51

2 52

3 53

4 54

5 55

c)

0 55

1 55

2 55

3 55

4 55

33.

Which of the functions can be used to delete column/row from a DataFrame?

a)

pop()

b)

at()

c)

drop()

d)

iloc()

34.

Which function can be used to combine dataframes based on common fields?

a)

merge()

b)

combine_first()

c)

concat()

35.

For the concat(), if the axis=1, it will join the dataframes ...............

a)

vertically

b)

horizontally

36.

Among the following functions, which one can be used to combine dataframes when they have similar structure.

a)

combine_first

b)

concat()

c)

merge()

37.

Series.tail(3) will return how many values.

a)

3 values from front

b)

3 values from last

c)

5 values

d)

none

38.

Series.head() will return how many rows.

a)

2

b)

3

c)

4

d)

5

39.

To extract subset from Series,the following function is used

a)

row()

b)

column()

c)

loc()

d)

all

40.

Full form of NaN is

a)

Not a Null

b)

Not a Number

c)

Not a Numeric

d)

None of these

41.

What is Matplotlib used for?

a)

Data Analysis

b)

Data Visualization

c)

Machine Learning

d)

Web Development

42.

Which command is used to install Matplotlib?

a)

pip install numpy

b)

pip install pandas

c)

pip install matplotlib

d)

pip install seaborn

43.

What does plt.show() do in Matplotlib?

a)

Saves the plot

b)

Displays the plot

c)

Clears the plot

d)

Closes the plot

44.

Which module is primarily used to create plots in Matplotlib?

a)

pyplot

b)

graph

c)

chart

d)

plotlib

45.

What is the default style of a Matplotlib plot?

a)

Grid

b)

Line

c)

Histogram

d)

Bar

46.

How can you change the figure size in Matplotlib?

a)

plt.figure(figsize=(width, height))

b)

plt.size(width, height)

c)

plt.plot_size(width, height)

d)

plt.change_size(width, height)

47.

Which function is used to create a bar chart in Matplotlib?

a)

plt.line()

c)

plt.scatter()

d)

plt.pie()

48.

Which argument is used to change the color of a line plot?

a)

color

b)

line_color

c)

c

d)

set_color

49.

Which function is used to create a scatter plot in Matplotlib?

a)

plt.line()

c)

plt.scatter()

d)

plt.pie()

50.

What does plt.xlabel() do?

a)

Sets the title

b)

Sets the x-axis label

c)

Sets the y-axis label

d)

Sets the legend

51.

What is the default style of Seaborn plots?

a)

whitegrid

b)

darkgrid

c)

ggplot

d)

classic

52.

Which function is used to create a box plot in Seaborn?

a)

sns.boxplot()

b)

sns.barplot()

c)

sns.histplot()

d)

sns.pairplot()

53.

What is a heatmap used for?

a)

To visualize correlation

b)

To compare categories

c)

To show trends

d)

To create bar plots

54.

Which function is used to create a histogram in Seaborn?

a)

sns.histplot()

b)

sns.scatterplot()

c)

sns.lineplot()

d)

sns.heatmap()

55.

Which function in Seaborn is used for pairwise relationships?

a)

sns.boxplot()

b)

sns.pairplot()

c)

sns.histplot()

d)

sns.violinplot()

56.

Which function is used to set the style of Seaborn plots?

a)

sns.set_style()

c)

sns.set()

d)

sns.theme()

57.

What does the hue argument do in Seaborn plots?

a)

Sets the color of all elements

b)

Groups data by a category

c)

Changes the font size

d)

Adjusts the figure size

58.

What is the main advantage of Seaborn over Matplotlib?

a)

Faster execution

b)

More statistical plotting functions

c)

Less memory usage

d)

Direct integration with Excel

59.

How we can find the type of numpy array in python?

a)

dtype

b)

typei

c)

type

d)

itype

60.

Shape() function in Numpy array is used to

a)

None of the Mentioned

b)

Change the shape of the array

c)

Assigns the desired shape to the array

d)

Find the shape of the array

61.

what is the use of the zeros() function in Numpy array in python ?

a)

To make a Matrix with first row 0

b)

To make a Matrix with all element 0

c)

To make a Matrix with all diagonal element 0

d)

None of the above

62.

Which of the following is not valid to import the numpy module ?

a)

import numpy as np

b)

import numpy as n

c)

import numpy as p

d)

None of the above

63.

What is the use of the size attribute in Numpy array in python ?

a)

It find the direction

b)

It find the shape

c)

It finds the number of items

d)

All of the above

64.

Which of the following find the maximum number in the Numpy array?

a)

max(array)

b)

array.max()

c)

array(max)

d)

None of the above

65.

x=np.array([10,20,30,40,50,60,70])

print(np.median(x))


Find the output

a)

35

b)

35.0

c)

40

d)

37.7

66.

How to use numpy ?

a)

import numpy as np

b)

import pandas as pd

c)

import pyplot as plt

d)

import math as np

67.

Name the function used to create an array?

a)

np.aray()

b)

np.array()

c)

Np.array()

d)

np.arange()

68.

names = np.array(["Reem" , "Salah" , "Haya" , "Maryam" , "Fatema"])

print(names([2,3,4]))

Mark the right output from the below options

a)

[ 'Haya' 'Maryam' 'Fatema' ]

b)

[ 'Maryam' 'Haya' 'Fatema' ]

c)

[ 'Reem' 'Salah' 'Fatema' ]

d)

[ 'Reem' 'Salah' 'Haya' ]

69.

Each location of an element in an array is called ______________

a)

Size

b)

Length

c)

Index

d)

Element

70.

import numpy as np

a = np.array([[0, 1, 2], [3, 4, 5]])

b = a.sum(axis=1)

print (b)

a)

3

b)

12

c)

[3 12]

d)

[3 5 7]

71.

__________ is a library used to create data structures and carry out scientific calculations.

a)

Python

b)

Numpy

c)

Pycharm

d)

Bar chart

72.

Full form of CSV file is ...................

a)

Comma Separated Vault

b)

Comma Separated Value

c)

Common Separated Value

d)

Common System Value

73.

Which is the correct Pandas syntax to read in a csv file and assign it to a DataFrame df?

a)

df = read_csv('file.csv')

b)

df = read('file.csv', type = 'csv')

c)

df = pd.read_csv('file.csv')

d)

df = with open('file.csv') as pd.DataFrame

74.

Which of the following object you get after reading CSV file?

a)

DataFrame

b)

Character Vector

c)

Panel

d)

All of the mentioned

75.

Which among these are correct , regarding csv files?

a)

A common format for data interchange

b)

Standard way to represent binary data.

c)

It can be opened in spreadsheet packages like MS-Excel, Calc etc

d)

There is no distinction between text and numeric values.