โ† All Data Science with Python Certification Flashcard Decks

Data Science with Python Data Cleaning and Preparation 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 Data Cleaning and Preparation flashcards as text
  1. Which pandas method returns a boolean DataFrame indicating where values are missing?

    Answer: df.isna()

    df.isna() (alias: df.isnull()) returns a boolean DataFrame with True where values are NaN.

  2. What does the `thresh` parameter in DataFrame.dropna() control?

    Answer: Minimum number of non-NaN values required to keep a row

    thresh=N keeps only rows/columns with at least N non-NaN values.

  3. You have a column with values ['1,200', '3,400', '500']. Which approach correctly converts these to integers?

    Answer: df['col'].str.replace(',', '').astype(int)

    You must strip the comma string characters before casting to int since commas are not valid numeric characters.

  4. Which scikit-learn class imputes missing values using the median of each feature column?

    Answer: SimpleImputer(strategy='median')

    SimpleImputer with strategy='median' fills NaN values with the column median.

  5. What is the primary risk of using forward fill (ffill) to impute time-series data?

    Answer: It propagates stale values across genuinely missing periods

    ffill carries the last valid observation forward, which can mask real gaps and bias analysis if the gap is long.

  6. Which pandas function is best suited for converting a column of mixed date strings to datetime objects?

    Answer: pd.to_datetime()

    pd.to_datetime() handles many date formats automatically and accepts the errors parameter for malformed entries.

  7. After one-hot encoding a categorical column with 5 unique values, how many new columns are created to avoid the dummy variable trap?

    Answer: 4

    Dropping one category (drop_first=True) leaves 4 columns, preventing perfect multicollinearity.

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

Data Science with Python Data Cleaning and Preparation Flashcards โ€” Data Science with Python Certification Study Cards with Answers