Site icon T4Tutorials.com

Python  Programming for Data Mining MCQs (Pandas, NumPy, Scikit-Learn)

1. : Which function in Pandas is used to read a CSV file?

(A) pandas.load_csv()


(B) pandas.read_csv()


(C) pandas.import_csv()


(D) pandas.open_csv()



2. : How do you check the first few rows of a DataFrame df in Pandas?

(A) df.start()


(B) df.first()


(C) df.head()


(D) df.preview()



3. : Which method is used to remove missing values from a DataFrame?

(A) dropna()


(B) remove_na()


(C) delete_na()


(D) discard_na()



4. : How do you create a new column in a Pandas DataFrame?

(A) df.new_column()


(B) df[‘new_column’] = values


(C) df.add_column(values)


(D) df.insert_column(values)



5. : What is the function to concatenate two DataFrames along rows?

(A) pd.concat([df1, df2])


(B) pd.append([df1, df2])


(C) pd.merge([df1, df2])


(D) pd.bind([df1, df2])



6. : Which function is used to create an array in NumPy?

(A) numpy.array()


(B) numpy.arr()


(C) numpy.create_array()


(D) numpy.new_array()



7. : How do you create an array of zeros with shape (3, 4) in NumPy?

(A) np.zeros([3, 4])


(B) np.zeros(3, 4)


(C) np.zeros((3, 4))


(D) np.zeros_array(3, 4)



8. : Which function returns the mean of an array?

(A) np.average(array)


(B) np.mean(array)


(C) np.median(array)


(D) np.mode(array)



9. : How do you find the shape of a NumPy array arr?

(A) arr.size


(B) arr.shape


(C) arr.dim()


(D) arr.length



10. : Which method would you use to stack arrays vertically in NumPy?

(A) np.vstack()


(B) np.hstack()


(C) np.stack()


(D) np.concat()



11. : Which module in Scikit-Learn is used for classification algorithms?

(A) sklearn.classification


(B) sklearn.cluster


(C) sklearn.tree


(D) sklearn.neighbors



12. : How do you split a dataset into training and testing sets in Scikit-Learn?

(A) train_test_split()


(B) split_data()


(C) test_train_split()


(D) data_split()



13. : What is the main purpose of the StandardScaler in Scikit-Learn?

(A) To standardize features by removing the mean and scaling to unit variance


(B) To normalize data between 0 and 1


(C) To encode categorical variables


(D) To reduce dimensionality of data



14. : Which class is used to perform linear regression in Scikit-Learn?

(A) sklearn.linear.LinearRegressor


(B) sklearn.regression.LinearModel


(C) sklearn.linear_model.LinearRegression


(D) sklearn.model.LinearRegressor



15. : What is the fit method used for in Scikit-Learn?

(A) To train a machine learning model


(B) To make predictions on new data


(C) To preprocess data


(D) To evaluate the model



16. : Which library is commonly used for data manipulation and analysis in Python?

(A) Matplotlib


(B) Seaborn


(C) Pandas


(D) SciPy



17. : Which of the following is used for numerical computations in Python?

(A) Numpy


(B) BeautifulSoup


(C) Flask


(D) TensorFlow



18. : What does the function pd.merge(df1, df2, on=’key’) do?

(A) Concatenates df1 and df2 along the ‘key’ column


(B) Joins df1 and df2 based on the ‘key’ column


(C) Adds a new column ‘key’ to df1 and df2


(D) Deletes the ‘key’ column from df1 and df2



19. : Which Scikit-Learn function is used to perform k-means clustering?

(A) KMeans()


(B) kmeans_cluster()


(C) ClusterKMeans()


(D) KMeansCluster()



20. : How do you calculate the correlation matrix of a DataFrame df in Pandas?

(A) df.corr()


(B) df.correlate()


(C) df.correlation()


(D) df.matrix()



 

More Next Data Mining MCQs

  1. Repeated Data Mining MCQs
  2. Classification in Data mining MCQs
  3. Clustering in Data mining MCQs
  4. Data Analysis and Experimental Design MCQs
  5. Basics of Data Science MCQs
  6. Big Data MCQs
  7. Caret Data Science MCQs 
  8. Binary and Count Outcomes MCQs
  9. CLI and Git Workflow

 

  1. Data Preprocessing MCQs
  2. Data Warehousing and OLAP MCQs
  3. Association Rule Learning MCQs
  4. Classification
  5. Clustering
  6. Regression MCQs
  7. Anomaly Detection MCQs
  8. Text Mining and Natural Language Processing (NLP) MCQs
  9. Web Mining MCQs
  10. Sequential Pattern Mining MCQs
  11. Time Series Analysis MCQs

Data Mining Algorithms and Techniques MCQs

  1. Frequent Itemset Mining MCQs
  2. Dimensionality Reduction MCQs
  3. Ensemble Methods MCQs
  4. Data Mining Tools and Software MCQs
  5. Python  Programming for Data Mining MCQs (Pandas, NumPy, Scikit-Learn)
  6. R Programming for Data Mining(dplyr, ggplot2, caret) MCQs
  7. SQL Programming for Data Mining for Data Mining MCQs
  8. Big Data Technologies MCQs
Exit mobile version