Skip to content

Commit d8c1672

Browse files
committed
Added a description to the examples.
1 parent 7c28463 commit d8c1672

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

pandas/core/frame.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@
182182
sort : boolean, default False
183183
Sort the join keys lexicographically in the result DataFrame. If False,
184184
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')
186186
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).
189189
copy : boolean, default True
190190
If False, avoid copy if possible.
191191
indicator : boolean or string, default False
@@ -256,8 +256,11 @@
256256
4 bar 2 bar 6
257257
5 baz 3 baz 7
258258
259+
Merge DataFrames A and B. Specify the left and right suffix
260+
to append to the name of any overlapping columns.
261+
259262
>>> A.merge(B, left_on='lkey', right_on='rkey', how='outer',
260-
suffixes=('_left', '_right'))
263+
... suffixes=('_left', '_right'))
261264
lkey value_left rkey value_right
262265
0 foo 1 foo 5
263266
1 foo 1 foo 8
@@ -266,10 +269,13 @@
266269
4 bar 2 bar 6
267270
5 baz 3 baz 7
268271
272+
Merge DataFrames A and B, but throw an error if the DataFrames have
273+
any overlapping columns.
274+
269275
>>> A.merge(B, left_on='lkey', right_on='rkey', how='outer',
270-
suffixes=(False, False))
276+
... suffixes=(False, False))
271277
Traceback (most recent call last):
272-
...
278+
...
273279
ValueError: columns overlap but no suffix specified:
274280
Index(['value'], dtype='object')
275281
"""

0 commit comments

Comments
 (0)