Wednesday_Addams
Wednesday_Addams 4d ago โ€ข 0 views

Multiple Choice Questions on Data Manipulation with Pandas

Hey there, future data wizards! ๐Ÿ‘‹ Ready to test your Pandas data manipulation skills? I've got a quick study guide and a practice quiz to help you ace it! Let's dive in! ๐Ÿค“
๐Ÿ’ป Computer Science & Technology
๐Ÿช„

๐Ÿš€ Can't Find Your Exact Topic?

Let our AI Worksheet Generator create custom study notes, online quizzes, and printable PDFs in seconds. 100% Free!

โœจ Generate Custom Content

1 Answers

โœ… Best Answer
User Avatar
alexander884 Jan 2, 2026

๐Ÿ“š Quick Study Guide

  • ๐Ÿ Pandas DataFrames: Two-dimensional, size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns).
  • ๐Ÿ“Š Series: One-dimensional labeled array capable of holding any data type.
  • ๐Ÿ“ Indexing: Selecting data based on labels (.loc[]) or integer positions (.iloc[]).
  • โœ‚๏ธ Slicing: Selecting a contiguous subset of rows and columns.
  • ๐Ÿงฎ Filtering: Selecting rows based on conditions (Boolean indexing).
  • โž• Adding Columns: Creating new columns or modifying existing ones.
  • ๐Ÿ—‘๏ธ Dropping Columns: Removing columns from a DataFrame.
  • ๐Ÿค Concatenation: Combining DataFrames vertically or horizontally.
  • โš™๏ธ Merging: Joining DataFrames based on common columns.
  • ๐Ÿ” GroupBy: Split-apply-combine strategy for data aggregation.
  • ๐Ÿ“ˆ Pivot Tables: Reshaping data for multi-dimensional analysis.
  • ๐Ÿงน Handling Missing Data: Using .fillna(), .dropna(), and .interpolate().

๐Ÿค” Practice Quiz

  1. Which Pandas function is used to read a CSV file into a DataFrame?
    1. A. pd.read_table()
    2. B. pd.read_csv()
    3. C. pd.load_csv()
    4. D. pd.open_csv()
  2. How do you select a column named 'Age' from a DataFrame called 'df'?
    1. A. df.loc['Age']
    2. B. df['Age']
    3. C. df.iloc['Age']
    4. D. df.get_column('Age')
  3. Which method is used to filter rows where the 'Salary' column is greater than 50000?
    1. A. df[df.Salary > 50000]
    2. B. df.filter(df.Salary > 50000)
    3. C. df.where(df.Salary > 50000)
    4. D. df.select(df.Salary > 50000)
  4. How do you add a new column named 'Bonus' to a DataFrame 'df', calculated as 10% of the 'Salary' column?
    1. A. df.add_column('Bonus', df.Salary * 0.1)
    2. B. df['Bonus'] = df.Salary * 0.1
    3. C. df.insert_column('Bonus', df.Salary * 0.1)
    4. D. df.new_column('Bonus', df.Salary * 0.1)
  5. Which function is used to group data by a column named 'Category' and calculate the mean of each group?
    1. A. df.groupby('Category').average()
    2. B. df.group('Category').mean()
    3. C. df.pivot_table('Category', aggfunc='mean')
    4. D. df.groupby('Category').mean()
  6. How do you fill missing values in a DataFrame 'df' with the mean of each column?
    1. A. df.fillna(df.mean())
    2. B. df.replace_na(df.mean())
    3. C. df.fillna(df.average())
    4. D. df.impute(df.mean())
  7. Which Pandas function is used to merge two DataFrames, 'df1' and 'df2', based on a common column 'ID'?
    1. A. pd.concat(df1, df2, on='ID')
    2. B. df1.join(df2, on='ID')
    3. C. pd.merge(df1, df2, on='ID')
    4. D. df1.merge(df2, on='ID')
Click to see Answers
  1. B
  2. B
  3. A
  4. B
  5. D
  6. A
  7. C

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! ๐Ÿš€