'data 'range( )}in [ ]pd merge(df df left_on='lkey'right_on='rkey'out[ ]data lkey data rkey you probably noticed that the 'cand 'dvalues and associated data are missing from the result by default merge does an 'innerjointhe keys in the result are the intersection other possible options are 'left''right'and 'outerthe outer join takes the union of the keyscombining the effect of applying both left and right joinsin [ ]pd merge(df df how='outer'out[ ]data key data nan nan many-to-many merges have well-defined though not necessarily intuitive behavior here' an examplein [ ]df dataframe({'key'[' '' '' '' '' '' ']'data 'range( )}in [ ]df dataframe({'key'[' '' '' '' '' ']'data 'range( )}in [ ]df out[ ]data key in [ ]df out[ ]data key in [ ]pd merge(df df on='key'how='left'out[ ]data key data combining and merging data sets www it-ebooks info