Skip to main contentSkip to solution

Which of the following is NOT a valid built-in Pandas method?

Solution

✅ Correct Option: 4

Pandas has no method called add_col. A new column is added with assignment, df[’new’] = values\text{df['new'] = values}, or with the methods insert() and assign().


Options 1 and 2: Series and DataFrame are Pandas' core classes, created as pd.Series() and pd.DataFrame(), so they are valid.

Option 3: read_sql_query() is a real Pandas function that runs a SQL query and returns a DataFrame.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question