pd.concat([a, b], axis=1) is used on two frames whose indexes overlap only partially. What is the default result?
Correct answer
C. The index union is used and missing labels produce NaN, as an outer join on the index
16 views
C. The index union is used and missing labels produce NaN, as an outer join on the index
16 views
Concatenation alignment: concat with axis=1 aligns on the index and defaults to join='outer', so the result covers the union of labels and fills gaps with NaN. join='inner' keeps only shared labels, and verify_integrity=True raises on duplicate labels. Because alignment is by label, differing row order between the frames is harmless, unlike positional concatenation.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is C? Ask here and get an explanation.