wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Pandas MCQ Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What is Pandas in Python?

a)

A data manipulation library

b)

A machine learning library

c)

A web development library

d)

A game development library

2.

Which function is used to create a DataFrame in Pandas?

a)

DataFrame()

b)

array()

c)

series()

d)

list()

3.

Which of the following is not a data structure provided by Pandas?

a)

DataFrame

b)

Series

c)

Panel

d)

Tensor

4.

What method is used to remove duplicate values in a DataFrame?

a)

remove_duplicates()

b)

drop_duplicates()

c)

delete_duplicates()

d)

eliminate_duplicates()

5.

Which function reads a CSV file into a Pandas DataFrame?

a)

read.csv()

b)

read_txt()

c)

read_csv()

d)

csv_read()

6.

What is the default axis value in the 'drop()' method in Pandas?

a)

axis=0

b)

axis=1

c)

axis=2

d)

axis=None

7.

How can you calculate the mean of each column in a DataFrame?

a)

mean(axis=0)

b)

mean(axis=1)

c)

avg(axis=0)

d)

average(axis=1)

8.

Which method is used to fill missing values in Pandas?

a)

fillna()

b)

fill()

c)

nanfill()

d)

replace_na()

9.

How can you concatenate two DataFrames vertically?

a)

concat(axis=0)

b)

concat(axis=1)

c)

merge(axis=0)

d)

join()

10.

Which of the following methods sorts a DataFrame by a column?

a)

sort_values()

b)

sort_by_column()

c)

order_by()

d)

arrange()

11.

What method is used to get the first n rows of a DataFrame?

a)

first(n)

b)

head(n)

c)

top(n)

d)

show(n)

12.

Which method is used to reset the index of a DataFrame?

a)

reset_index()

b)

restart_index()

c)

index_reset()

d)

index_restart()

13.

How can you access a group of rows and columns using labels?

a)

loc

b)

iloc

c)

index

d)

row_col

14.

Which function can merge two DataFrames?

a)

join()

b)

append()

c)

merge()

d)

concatenate()

15.

How can you convert a DataFrame to a NumPy array?

a)

to_numpy()

b)

toarray()

c)

asarray()

d)

to_matrix()

16.

Which method returns the shape of a DataFrame?

a)

shape()

b)

df_shape()

c)

get_shape()

d)

size()

17.

How can you create a copy of a DataFrame?

a)

copy()

b)

deepcopy()

c)

clone()

d)

make_copy()

18.

What method checks for any missing values in a DataFrame?

a)

isnull()

b)

hasnull()

c)

find_null()

d)

check_na()

19.

Which Pandas data structure is one-dimensional?

a)

Series

b)

DataFrame

c)

Panel

d)

Matrix

20.

Which method changes column names in a DataFrame?

a)

rename()

b)

change_column_name()

c)

set_column_name()

d)

update_names()

21.

How can you apply a function to each element in a DataFrame?

a)

applymap()

b)

map()

c)

apply()

d)

transform()

22.

What method returns the index of the maximum value?

a)

idxmax()

b)

max_index()

c)

find_max()

d)

max_idx()

23.

Which Pandas function reads data from an Excel file?

a)

read_excel()

b)

load_excel()

c)

open_excel()

d)

excel_read()

24.

How do you display basic statistics of a DataFrame?

a)

describe()

b)

summary()

c)

stats()

d)

details()

25.

How can you drop rows with missing values?

a)

dropna()

b)

dropnull()

c)

removena()

d)

cleanna()

26.

What is the default join type in Pandas merge?

a)

Inner

b)

Outer

c)

Left

d)

Right

27.

How can you group data by one or more columns?

a)

groupby()

b)

group_data()

c)

bygroup()

d)

aggregate()

28.

Which function is used to add a new column to a DataFrame?

a)

assign()

b)

append()

c)

add_column()

d)

insert_column()

29.

What method converts a Series to a list?

a)

to_list()

b)

listify()

c)

aslist()

d)

series_to_list()

30.

How can you filter rows based on a condition?

a)

query()

b)

filter()

c)

select()

d)

where()