Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pandas Data Handling

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

What is data filtering in pandas?

a)

Data filtering in pandas refers to merging multiple DataFrames.

b)

Data filtering in pandas is the process of sorting data alphabetically.

c)

Data filtering in pandas is the process of selecting rows or columns of a DataFrame based on specified conditions or criteria.

d)

Data filtering in pandas involves converting data types within a DataFrame.

2.

How can you filter data based on a specific condition in pandas?

a)

Using the 'iloc' method with the condition inside square brackets

b)

Directly modifying the data without any condition

c)

Using the 'loc' method with the condition inside square brackets

d)

Applying the 'filter' function with the condition as an argument

3.

Explain the difference between loc and iloc in pandas.

a)

loc is position-based, iloc is label-based

b)

loc is label-based, iloc is integer position-based

c)

loc is integer-based, iloc is label-based

d)

loc is label-based, iloc is position-based

4.

What is the purpose of the isnull() method in pandas?

a)

To calculate the mean of a Series

b)

To detect missing values in a DataFrame or Series.

c)

To sort the data in a DataFrame

d)

To convert strings to integers in a Series

5.

What is data visualization in pandas?

a)

Data visualization in pandas involves writing code without any visual output

b)

Data visualization in pandas is a process of converting text data into audio files

c)

Data visualization in pandas involves creating plots, charts, and graphs to help understand and analyze data more effectively.

d)

Data visualization in pandas refers to creating 3D models

6.

List some commonly used plots for data visualization in pandas.

a)

heatmap plots

b)

line plots, bar plots, scatter plots, histogram plots, box plots

c)

area plots

d)

pie plots

7.

How can you create a line plot in pandas?

a)

df.plot(kind='bar')

b)

df.plot(kind='line')

c)

df.plot(kind='hist')

d)

df.plot(kind='scatter')

8.

What is the purpose of the histogram plot in pandas?

a)

To display the mean value of a numerical variable

b)

To visualize the distribution of a numerical variable by displaying the frequency of observations within each bin.

c)

To show the correlation between two numerical variables

d)

To represent the trend of a time series data

9.

How can you customize the appearance of a plot in pandas?

a)

Modify the data source

b)

Change the font style

c)

Adjust the page margins

d)

Use parameters like 'color', 'linestyle', 'linewidth', 'marker', 'title', 'xlabel', 'ylabel', 'grid', 'legend' in the plot function or by accessing the plot object to customize the appearance.

10.

What is the role of the legend in a pandas plot?

a)

The legend in a pandas plot adjusts the axis labels.

b)

The legend in a pandas plot provides information about the elements displayed in the plot.

c)

The legend in a pandas plot changes the color scheme of the plot.

d)

The legend in a pandas plot determines the plot size.

11.

How can you save a plot as an image file in pandas?

a)

plot_object.savefig('filename.png')

b)

plot_object.save('filename.png')

c)

plot_object.export('filename.png')

d)

plot_object.save_image('filename.png')

12.

Explain the concept of subplots in pandas data visualization.

a)

Subplots in pandas data visualization are used to remove outliers from the dataset.

b)

Subplots in pandas data visualization are only applicable to categorical data.

c)

Subplots in pandas data visualization allow for 3D plotting of data points.

d)

Subplots in pandas data visualization enable the creation of multiple plots within the same figure, facilitating comparison and visualization of various aspects of the data.

13.

What is the purpose of the title() method in pandas plots?

a)

To set the title of the plot.

b)

To add a legend to the plot.

c)

To adjust the plot size.

d)

To change the data type of the plot.