Quiz Part 1: Foundations of Machine Learning and Python
Chapter 2: Python and Essential Libraries for Data Science
Question 5:
What is the main advantage of using NumPy arrays over Python lists in machine learning?
a) NumPy arrays can store mixed data types, while lists cannot.
b) NumPy arrays are more memory-efficient and support faster numerical computations.
c) Python lists are faster than NumPy arrays for mathematical operations.
d) NumPy arrays are limited to two dimensions, while lists can store multi-dimensional data.
Question 6:
How do you reshape a 1D NumPy array into a 2D array with 3 rows and 2 columns?
a) array.reshape((2, 3))
b) array.reshape((3, 2))
c) array.reshape((3))
d) array.reshape((2, 1, 3))
Question 7:
Which Pandas function is used to detect missing values in a DataFrame?
a) fillna()
b) dropna()
c) isnull()
d) apply()
Question 8:
In Matplotlib, which function is used to create a scatter plot?
a) plt.plot()
b) plt.bar()
c) plt.scatter()
d) plt.hist()
Question 9:
What is the purpose of OneHotEncoder in Scikit-learn?
a) It scales numerical features to have a mean of 0 and a standard deviation of 1.
b) It encodes categorical features as binary vectors.
c) It imputes missing data.
d) It reduces the dimensions of a dataset.
Question 10:
Which library in Python is best suited for creating interactive visualizations?
a) Matplotlib
b) Seaborn
c) Plotly
d) NumPy
Question 11:
What function in Scikit-learn is used to split a dataset into training and test sets?
a) train_test_split()
b) fit()
c) StandardScaler()
d) GridSearchCV()
Question 12:
Which cloud-based platform allows you to use free GPUs and TPUs for machine learning?
a) Jupyter Notebooks
b) Anaconda
c) Google Colab
d) PyCharm
Chapter 2: Python and Essential Libraries for Data Science
Question 5:
What is the main advantage of using NumPy arrays over Python lists in machine learning?
a) NumPy arrays can store mixed data types, while lists cannot.
b) NumPy arrays are more memory-efficient and support faster numerical computations.
c) Python lists are faster than NumPy arrays for mathematical operations.
d) NumPy arrays are limited to two dimensions, while lists can store multi-dimensional data.
Question 6:
How do you reshape a 1D NumPy array into a 2D array with 3 rows and 2 columns?
a) array.reshape((2, 3))
b) array.reshape((3, 2))
c) array.reshape((3))
d) array.reshape((2, 1, 3))
Question 7:
Which Pandas function is used to detect missing values in a DataFrame?
a) fillna()
b) dropna()
c) isnull()
d) apply()
Question 8:
In Matplotlib, which function is used to create a scatter plot?
a) plt.plot()
b) plt.bar()
c) plt.scatter()
d) plt.hist()
Question 9:
What is the purpose of OneHotEncoder in Scikit-learn?
a) It scales numerical features to have a mean of 0 and a standard deviation of 1.
b) It encodes categorical features as binary vectors.
c) It imputes missing data.
d) It reduces the dimensions of a dataset.
Question 10:
Which library in Python is best suited for creating interactive visualizations?
a) Matplotlib
b) Seaborn
c) Plotly
d) NumPy
Question 11:
What function in Scikit-learn is used to split a dataset into training and test sets?
a) train_test_split()
b) fit()
c) StandardScaler()
d) GridSearchCV()
Question 12:
Which cloud-based platform allows you to use free GPUs and TPUs for machine learning?
a) Jupyter Notebooks
b) Anaconda
c) Google Colab
d) PyCharm
Chapter 2: Python and Essential Libraries for Data Science
Question 5:
What is the main advantage of using NumPy arrays over Python lists in machine learning?
a) NumPy arrays can store mixed data types, while lists cannot.
b) NumPy arrays are more memory-efficient and support faster numerical computations.
c) Python lists are faster than NumPy arrays for mathematical operations.
d) NumPy arrays are limited to two dimensions, while lists can store multi-dimensional data.
Question 6:
How do you reshape a 1D NumPy array into a 2D array with 3 rows and 2 columns?
a) array.reshape((2, 3))
b) array.reshape((3, 2))
c) array.reshape((3))
d) array.reshape((2, 1, 3))
Question 7:
Which Pandas function is used to detect missing values in a DataFrame?
a) fillna()
b) dropna()
c) isnull()
d) apply()
Question 8:
In Matplotlib, which function is used to create a scatter plot?
a) plt.plot()
b) plt.bar()
c) plt.scatter()
d) plt.hist()
Question 9:
What is the purpose of OneHotEncoder in Scikit-learn?
a) It scales numerical features to have a mean of 0 and a standard deviation of 1.
b) It encodes categorical features as binary vectors.
c) It imputes missing data.
d) It reduces the dimensions of a dataset.
Question 10:
Which library in Python is best suited for creating interactive visualizations?
a) Matplotlib
b) Seaborn
c) Plotly
d) NumPy
Question 11:
What function in Scikit-learn is used to split a dataset into training and test sets?
a) train_test_split()
b) fit()
c) StandardScaler()
d) GridSearchCV()
Question 12:
Which cloud-based platform allows you to use free GPUs and TPUs for machine learning?
a) Jupyter Notebooks
b) Anaconda
c) Google Colab
d) PyCharm
Chapter 2: Python and Essential Libraries for Data Science
Question 5:
What is the main advantage of using NumPy arrays over Python lists in machine learning?
a) NumPy arrays can store mixed data types, while lists cannot.
b) NumPy arrays are more memory-efficient and support faster numerical computations.
c) Python lists are faster than NumPy arrays for mathematical operations.
d) NumPy arrays are limited to two dimensions, while lists can store multi-dimensional data.
Question 6:
How do you reshape a 1D NumPy array into a 2D array with 3 rows and 2 columns?
a) array.reshape((2, 3))
b) array.reshape((3, 2))
c) array.reshape((3))
d) array.reshape((2, 1, 3))
Question 7:
Which Pandas function is used to detect missing values in a DataFrame?
a) fillna()
b) dropna()
c) isnull()
d) apply()
Question 8:
In Matplotlib, which function is used to create a scatter plot?
a) plt.plot()
b) plt.bar()
c) plt.scatter()
d) plt.hist()
Question 9:
What is the purpose of OneHotEncoder in Scikit-learn?
a) It scales numerical features to have a mean of 0 and a standard deviation of 1.
b) It encodes categorical features as binary vectors.
c) It imputes missing data.
d) It reduces the dimensions of a dataset.
Question 10:
Which library in Python is best suited for creating interactive visualizations?
a) Matplotlib
b) Seaborn
c) Plotly
d) NumPy
Question 11:
What function in Scikit-learn is used to split a dataset into training and test sets?
a) train_test_split()
b) fit()
c) StandardScaler()
d) GridSearchCV()
Question 12:
Which cloud-based platform allows you to use free GPUs and TPUs for machine learning?
a) Jupyter Notebooks
b) Anaconda
c) Google Colab
d) PyCharm