A data analyst needs to combine two datasets that have the same columns but different rows. Which operation should they use?
Trap 1: Concatenate
Concatenate can be ambiguous; in pandas, it can combine along rows or columns, but append is more specific.
Trap 2: Merge
Merge is for combining on a common key, not simply adding rows.
Trap 3: Aggregate
Aggregate summarizes data, not combine rows.
- A
Concatenate
Why it fails: Concatenate can be ambiguous; in pandas, it can combine along rows or columns, but append is more specific.
- B
Append
Append (concatenation) stacks datasets vertically, adding the rows of one table beneath the other while retaining identical column structures. Because both datasets share the same columns but hold different rows, this operation satisfies the stem's requirement without matching keys, unlike a join.
- C
Merge
Why it fails: Merge is for combining on a common key, not simply adding rows.
- D
Aggregate
Why it fails: Aggregate summarizes data, not combine rows.