What does the pd.concat() operation in pandas do?
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().
Related questions:
2025: 27 May Shift 2
2026: 23 May Shift 2