Font size
WorksheetsData Preprocessing - 1
Total questions: 40
Worksheet time: 38mins
What does np.random.rand(2,3) generate?
2D array with random integers
2D array with random floats between 0 and 1
3D array with random integers
Array with random Gaussian distribution
What does np.linspace(0, 10, 5) produce?
Five evenly spaced numbers from 0 to 10
Ten evenly spaced numbers from 0 to 5
Sequence of integers
None of the above
What is the output of np.eye(3)?
3×3 identity matrix
3×3 zero matrix
3×3 matrix of ones
None of the above
Which NumPy method is used to check for NaN values?
np.isnan()
np.isnull()
np.missing()
np.check_nan()
Which NumPy function is used to compute the cumulative sum?
np.cumsum()
np.sum()
np.add()
np.total()
In NumPy, axis=1 in a sum function means:
Sum across columns
Sum across rows
Sum diagonally
Sum all elements
Which function is used to write a DataFrame to a CSV file?
to_csv()
write_csv()
save_csv()
export_csv()
What does df.head(3) do?
Returns first 3 rows
Returns last 3 rows
Returns first 3 columns
Returns first 3 values
Which pandas function resets the index of a DataFrame?
reset_index()
drop_index()
clear_index()
set_index()
Which function gives the count of non-null values per column?
count()
len()
non_null()
notnull()
Which method is used to remove a specific column in pandas?
drop()
remove()
delcol()
delete()
Which attribute of DataFrame shows the number of rows and columns?
shape
ndim
size
count
Which pandas data structure is 1-dimensional?
Series
DataFrame
Panel
Array
Which function is used to create a line plot in matplotlib?
plt.plot()
plt.line()
plt.draw()
plt.graph()
Which function displays the plot on the screen?
plt.show()
plt.display()
plt.plot()
plt.render()
Which function is used to set the title of a plot?
plt.title()
plt.heading()
plt.caption()
plt.head()
Which matplotlib function is used to create a histogram?
plt.hist()
plt.bar()
plt.histogram()
plt.chart()
How do you label the X-axis in matplotlib?
plt.xlabel()
plt.xaxis()
plt.set_xlabel()
plt.labelx()
Which function is used for scatter plots?
plt.scatter()
plt.plot()
plt.dotplot()
plt.points()
Which argument in plt.plot() is used for line style?
linestyle
line
style
ls
What does plt.grid(True) do?
Shows grid lines
Removes grid lines
Creates a table
None of the above
Which imputation method is preferred for continuous numeric data?
Mean
Mode
Median
None of the above
Which library contains StandardScaler?
scikit-learn
pandas
numpy
matplotlib
What is the purpose of label encoding?
Convert categorical to numeric
Normalize numeric values
Remove missing values
Detect outliers
What does one-hot encoding create?
Dummy variables
Continuous features
Missing values
Labels
Which library function is used for one-hot encoding?
pd.get_dummies()
np.dummies()
plt.dummies()
sklearn.get_dummies()
Which method detects outliers using quartiles?
IQR
Z-score
Boxplot
Standard deviation
Which measure of central tendency is the middle value?
Mean
Median
Mode
Range
Which measure represents the spread of data?
Variance
Mean
Median
Mode
Which distribution is symmetric and bell-shaped?
Normal distribution
Poisson distribution
Binomial distribution
Exponential distribution
Which measure is most affected by outliers?
Mean
Median
Mode
Range
What does standard deviation measure?
Dispersion
Central tendency
Skewness
Kurtosis
What is the probability of an impossible event?
0
1
0.5
Undefined
Which value divides the dataset into two equal halves?
Median
Mean
Mode
Range
Which statistic measures the relationship between two variables?
Correlation
Variance
Mean
Standard deviation
What does np.sum([1, 2, 3]) return?
None of the above
6
1
3
What is the purpose of the dropna() function in pandas?
Group data
Sort values
Fill missing values
Remove missing values
Which function is used to create a scatter plot in matplotlib?
plt.bar()
plt.plot()
plt.line()
plt.scatter()
Which method is used to fill missing values in a DataFrame?
fill_missing()
impute()
replace_na()
fillna()
What does the function pd.concat() do?
Concatenates DataFrames
Splits DataFrames
Joins DataFrames
Merges DataFrames
