wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Preprocessing

Total questions: 40

Worksheet time: 40mins

Name
Class
Date
1.

What is the formula for IQR?

a)

Q3 − Q1

b)

Q1 − Q3

c)

Q2 − Q1

d)

Q3 − Q2

2.

If Q1 = 10 and Q3 = 30, what is IQR?

a)

10

b)

20

c)

40

d)

15

3.

Which rule is commonly used with IQR to detect outliers?

a)

±1.5 * IQR

b)

±2 * IQR

c)

±3 * IQR

d)

±0.5 * IQR

4.

If a value lies below Q1 − 1.5*IQR, it is considered:

a)

Normal data

b)

Outlier

c)

Median

d)

Missing value

5.

Which library provides a direct function to compute IQR?

a)

NumPy

b)

Scipy (iqr())

c)

Matplotlib

d)

Pandas

6.

Which visualization best identifies IQR-based outliers?

a)

Scatter plot

b)

Boxplot

c)

Line plot

d)

Histogram

7.

IQR is resistant to:

a)

Outliers

b)

Mean shift

c)

Scaling

d)

Skewness

8.

Why is IQR preferred over range?

a)

Uses only extremes

b)

Not affected by outliers

c)

Easier to compute

d)

Gives mean

9.

Which of the following is NOT a method of handling missing values?

a)

Deletion

b)

Imputation

c)

Interpolation

d)

Overfitting

10.

What does df.dropna() do in Pandas?

a)

Replaces NaN with 0

b)

Removes rows with NaN

c)

Removes columns only

d)

Fills with mean

11.

Which method is better for categorical missing data?

a)

Mode imputation

b)

Mean imputation

c)

Median imputation

d)

Min-max scaling

12.

Outlier treatment by replacing extreme values with thresholds is called:

a)

Winsorization

b)

Standardization

c)

Normalization

d)

Transformation

13.

If numeric data has extreme skewness, which transformation works best?

a)

Log

b)

Square

c)

Cube

d)

Exponential

14.

Which function replaces inappropriate values in Pandas?

a)

df.fillna()

b)

df.replace()

c)

df.dropna()

d)

df.fill()

15.

Which method is best for handling inconsistent categorical data (‘male’, ‘Male’, ‘M’)?

a)

Lowercasing + Mapping

b)

Drop data

c)

Random replacement

d)

One-hot encoding directly

16.

Which type of inappropriate data is best handled with regex replacement?

a)

Missing values

b)

Outliers

c)

Textual noise (special chars, typos)

d)

Duplicate rows

17.

Which function standardizes column names?

a)

df.rename()

b)

df.label()

c)

df.columns_update()

d)

df.fixnames()

18.

Which Pandas function removes duplicate rows?

a)

df.remove_duplicates()

b)

df.drop_duplicates()

c)

df.clean_duplicates()

d)

df.unique()

19.

Which Pandas method fills missing values using forward propagation?

a)

df.fillna(method='ffill')

b)

df.fillna(method='bfill')

c)

df.interpolate()

d)

df.dropna()

20.

To normalize a column between 0 and 1 using Pandas:

a)

(df - df.min())/(df.max()-df.min())

b)

df/df.mean()

c)

df/df.std()

d)

None

21.

Which method is used to detect null values in Pandas?

a)

df.isnull()

b)

df.null()

c)

df.isnan()

d)

df.na()

22.

Which Pandas method helps to bin continuous values?

a)

pd.cut()

b)

pd.bin()

c)

pd.groupby()

d)

pd.discretize()

23.

Which function detects outliers using Z-score in Pandas (with NumPy)?

a)

(df-mean)/std

b)

df.describe()

c)

df.skew()

d)

df.corr()

24.

Which method is used to apply custom preprocessing functions row-wise?

a)

df.map()

b)

df.apply()

c)

df.applymap()

d)

df.transform()

25.

Which Scikit-learn class standardizes features?

a)

MinMaxScaler

b)

StandardScaler

c)

Normalizer

d)

LabelEncoder

26.

Which class normalizes each row vector to unit length?

a)

Normalizer

b)

StandardScaler

c)

PCA

d)

RobustScaler

27.

Which encoder is best for nominal categorical features?

a)

OneHotEncoder

b)

LabelEncoder

c)

OrdinalEncoder

d)

StandardScaler

28.

Which method handles outliers better during scaling?

a)

RobustScaler

b)

MinMaxScaler

c)

StandardScaler

d)

Normalizer

29.

Which function splits dataset into training and testing in sklearn?

a)

train_test_split()

b)

split_train_test()

c)

dataset_split()

d)

sklearn.split()

30.

Which module provides preprocessing utilities?

a)

sklearn.preprocessing

b)

sklearn.data

c)

sklearn.utils

d)

sklearn.cleaning

31.

Which imputer replaces missing values with mean, median, or most_frequent?

a)

SimpleImputer

b)

KNNImputer

c)

RobustImputer

d)

None

32.

Which sklearn method is used for dimensionality reduction?

a)

PCA

b)

MinMaxScaler

c)

Imputer

d)

LabelEncoder

33.

Which plot best shows distribution of a variable?

a)

Line plot

b)

Histogram

c)

Scatter

d)

Bar

34.

Which plot is most useful for detecting outliers?

a)

Histogram

b)

Boxplot

c)

Pie chart

d)

Heatmap

35.

Which function in Seaborn creates pairwise plots?

a)

sns.pairplot()

b)

sns.scatter()

c)

sns.jointplot()

d)

sns.gridplot()

36.

Which Seaborn plot is used for categorical vs numerical data?

a)

sns.barplot()

b)

sns.scatterplot()

c)

sns.histplot()

d)

sns.kdeplot()

37.

Which function in Seaborn shows correlation heatmap?

a)

sns.heatmap(df.corr())

b)

sns.corrplot()

c)

sns.matrixplot()

d)

sns.colorplot()

38.

Which plot shows density distribution?

a)

Histogram

b)

KDE Plot

c)

Boxplot

d)

Bar plot

39.

Which argument in Seaborn controls color theme?

a)

palette

b)

color

c)

style

d)

theme

40.

Which function in Matplotlib displays multiple subplots?

a)

plt.subplot()

b)

plt.multiplot()

c)

plt.grid()

d)

plt.subgraph()