Skip to main contentSkip to solution

What does the pd.concat() operation in pandas do?

Solution

✅ Correct Option: 2

pd.concat() joins two or more pandas objects (DataFrames or Series) along a chosen axis. With axis=0 (the default) it stacks them vertically, adding rows. With axis=1 it places them side by side, adding columns.


Option 1: combining by key is what pd.merge() (or join()) does. concat() joins by position or index along an axis, not on a key column.

Option 3: row filtering is done with boolean indexing, loc, or query().

Option 4: exporting to CSV is done with to_csv().

Keyboard Shortcuts

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