Skip to main contentSkip to solution

Solution

✅ Correct Option: 1,3

pandas provides pd.concat() to join two or more DataFrames, stacking them along rows (axis 0) or side by side along columns (axis 1).

DataFrame.append() also adds the rows of one DataFrame to another, so it is the second accepted option.


concatenate(): this is a NumPy function (np.concatenate) for arrays, not a pandas function for DataFrames.

union(): this belongs to sets, Index objects and Spark DataFrames, not to pandas DataFrames.

append() was removed in pandas 2.0, so in current versions pd.concat() is the one to use.

Keyboard Shortcuts

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