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()