Data Science with Python (Basic) Flashcards
7 cards from real Data Science with Python Certification practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Data Science with Python (Basic) flashcards as text
Which NumPy function creates an array of evenly spaced values over a specified interval?
Answer: np.linspace()
np.linspace() returns evenly spaced numbers over a specified interval, including both endpoints by default.
In pandas, what does the method df.dropna() do by default?
Answer: Drops rows with any missing values
By default, df.dropna() removes any row that contains at least one NaN value (axis=0).
What is the output of np.array([1,2,3]).reshape(3,1).shape?
Answer: (3,1)
reshape(3,1) converts the 1-D array into a 2-D column vector with 3 rows and 1 column, so shape is (3,1).
Which pandas method is used to compute summary statistics (mean, std, min, max) for a DataFrame?
Answer: df.describe()
df.describe() generates descriptive statistics including count, mean, std, min, quartiles, and max for numeric columns.
In Matplotlib, which function saves the current figure to a file?
Answer: plt.savefig()
plt.savefig('filename.png') saves the current figure to disk in the specified format.
What does the pandas method df.groupby('col').mean() return?
Answer: Mean values for each unique group in 'col'
groupby splits the DataFrame by unique values of 'col', then mean() computes the average of all other numeric columns within each group.
Which scikit-learn class is used to split data into training and test sets?
Answer: sklearn.model_selection.train_test_split
train_test_split from sklearn.model_selection randomly partitions arrays or matrices into train and test subsets.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy