Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data handling using pandas and Data visualization

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Data Frame in pandas is

a)

a) 1 dimensional array

b)

b) 2 dimensional array

c)

c) 3 dimensional array

d)

d) None of the above

2.

Which of the following takes a dict of dicts or a dict of array-like sequences and returns a DataFrame?

a)

a) DataFrame.from_items

b)

b) DataFrame.from_records

c)

c) DataFrame.from_dict

d)

d) All of the mentioned

3.

This function in the library of Pandas allows you to manipulate data and create new variables:

a)

a) read_csv function

b)

b) Pivot_table function

c)

c) apply function

d)

d) merge function

4.

______________ function returns current date and time.

a)

a) SET DATEFIRST

b)

b) SYSDATETIME

c)

c) Cert_ID

d)

d) GETDATE

5.

In a SELECT with a GROUP BY clause, a WHERE clause, and a HAVING clause, the WHERE conditions are applied before the HAVING conditions.

a)

a) True

b)

b) False

c)

c) Either True or False

d)

d) None of the above

6.

We apply the aggregate function to a group of sets of tuples using the _______ clause.

a)

a) group by

b)

b) group

c)

c) group set

d)

d) group attribute

7.

What is the output of the following program?

squares = {1:1, 2:4, 3:9, 4:16, 5:25}

print(squares.pop(4))

print(squares)

a)

16

{1: 1, 2: 4, 3: 9, 5: 25}

b)

16

{1: 1, 2: 4, 3: 9, 4:16, 5: 25}

c)

4

{1: 1, 2: 4, 3: 9, 5: 25}

d)

4

{1: 1, 2: 4, 3: 9, 4:16, 5: 25}

8.

Which is a python package used for 2D graphics?

a)

A. matplotlib.pyplot

b)

B. matplotlib.pip

c)

C. matplotlib.numpy

d)

D. matplotlib.plt

9.

To install matplotlib, the following function will be typed in your command prompt. What does “-U”represents?

Python –m pip install –U pip

a)

A. downloading pip to the latest version

b)

B . upgrading pip to the latest version

c)

C. removing pip

d)

D. upgrading matplotlib to the latest version

10.

The expansion of CRLF is

a)

A. Control Return and Line Feed

b)

B. Carriage Return and Form Feed

c)

C. Control Router and Line Feed

d)

D .Carriage Return and Line Fee

11.

Which of the following creates an object which maps data to a dictionary?

a)

A. listreader()

b)

B. reader()

c)

C. tuplereader()

d)

D. DicReader ()

12.

Identify the right type of chart using the following hints.

Hint 1: This chart is often used to visualize a trend in data over intervals of time.

Hint 2: The line in this type of chart is often drawn chronologically.

a)

A. Line chart

b)

B Bar chart

c)

C. Pie chart

d)

D. Scatter plot

13.

Which of the following is correct Features of DataFrame?

a)

A. Potentially columns are of different types

b)

B. Can Perform Arithmetic operations on rows and columns

c)

C. Labeled axes (rows and columns)

d)

D. All of the above

14.

What is the output of the following program?

y = 8

z = lambda x: x * y

print z (6)

a)

A. 48

b)

B. 14

c)

C. 64

d)

D. None of the above

15.

What will be the output of the following Python code snippet?

d1 = {"john":40, "peter":45}

d2 = {"john":466, "peter":45}

d1 > d2

a)

a) True

b)

b) False

c)

c) Error

d)

d) None

16.

What does the function re.match do?

a)

(A) matches a pattern at the start of the string

b)

(B) matches a pattern at any position in the string

c)

(C) such a function does not exist

d)

(D) none of the mentioned

17.

Point out the correct combination with regards to kind keyword for graph plotting.

a)

a) ‘hist’ for histogram

b)

b) ‘box’ for boxplot

c)

c) ‘area’ for area plots

d)

d) all of the mentioned

18.

In regards to separated value files such as .csv and .tsv, what is the delimiter?

a)

a) Any character such as the comma (,) or tab (\t) that is used to separate the column data.

b)

b) Any character such as the comma (,) or tab (\t) that is used to separate the row data

c)

c) Anywhere the comma (,) character is used in the file

d)

d) Delimiters are not used in separated value files

19.

In data science, which of the python library are more popular ?

a)

a. Numpy

b)

b. Pandas

c)

c. OpenCv

d)

d. Django

20.

Which of the following is incorrect file handling mode in Python

a)

a) r

b)

b) x

c)

c) t+

d)

d) b