|
182 | 182 | sort : boolean, default False
|
183 | 183 | Sort the join keys lexicographically in the result DataFrame. If False,
|
184 | 184 | the order of the join keys depends on the join type (how keyword).
|
185 |
| -suffixes : 2-length sequence (tuple, list, ...) |
| 185 | +suffixes : tuple of (str, str), default ('_x', '_y') |
186 | 186 | Suffix to apply to overlapping column names in the left and right
|
187 |
| - side, respectively. If (False, False), overlapping |
188 |
| - column names raise an error. |
| 187 | + side, respectively. To raise an exption on overlapping columns use |
| 188 | + (False, False). |
189 | 189 | copy : boolean, default True
|
190 | 190 | If False, avoid copy if possible.
|
191 | 191 | indicator : boolean or string, default False
|
|
256 | 256 | 4 bar 2 bar 6
|
257 | 257 | 5 baz 3 baz 7
|
258 | 258 |
|
| 259 | +Merge DataFrames A and B. Specify the left and right suffix |
| 260 | +to append to the name of any overlapping columns. |
| 261 | +
|
259 | 262 | >>> A.merge(B, left_on='lkey', right_on='rkey', how='outer',
|
260 |
| - suffixes=('_left', '_right')) |
| 263 | +... suffixes=('_left', '_right')) |
261 | 264 | lkey value_left rkey value_right
|
262 | 265 | 0 foo 1 foo 5
|
263 | 266 | 1 foo 1 foo 8
|
|
266 | 269 | 4 bar 2 bar 6
|
267 | 270 | 5 baz 3 baz 7
|
268 | 271 |
|
| 272 | +Merge DataFrames A and B, but throw an error if the DataFrames have |
| 273 | +any overlapping columns. |
| 274 | +
|
269 | 275 | >>> A.merge(B, left_on='lkey', right_on='rkey', how='outer',
|
270 |
| - suffixes=(False, False)) |
| 276 | +... suffixes=(False, False)) |
271 | 277 | Traceback (most recent call last):
|
272 |
| - ... |
| 278 | +... |
273 | 279 | ValueError: columns overlap but no suffix specified:
|
274 | 280 | Index(['value'], dtype='object')
|
275 | 281 | """
|
|
0 commit comments