@@ -30,15 +30,21 @@ def merge(left, right, how='left', on=None, left_on=None, right_on=None,
30
30
* outer: use union of keys from both frames (SQL: full outer join)
31
31
* inner: use intersection of keys from both frames (SQL: inner join)
32
32
on : label or list
33
- Field names to join on. Must be found in both DataFrames
34
- left_on : label or list
35
- Field names to join on in left DataFrame
36
- right_on : label or list
37
- Field names to join on in right DataFrame
33
+ Field names to join on. Must be found in both DataFrames.
34
+ left_on : label or list, or array-like
35
+ Field names to join on in left DataFrame. Can be a vector or list of
36
+ vectors of the length of the DataFrame to use a particular vector as
37
+ the join key instead of columns
38
+ right_on : label or list, or array-like
39
+ Field names to join on in right DataFrame or vector/list of vectors per
40
+ left_on docs
38
41
left_index : boolean, default True
39
- Use the index from the left DataFrame as the join key
42
+ Use the index from the left DataFrame as the join key(s). If it is a
43
+ MultiIndex, the number of keys in the other DataFrame (either the index
44
+ or a number of columns) must match the number of levels
40
45
right_index : boolean, default True
41
- Use the index from the right DataFrame as the join key
46
+ Use the index from the right DataFrame as the join key. Same caveats as
47
+ left_index
42
48
sort : boolean, default True
43
49
Sort the join keys lexicographically in the result DataFrame
44
50
suffixes : 2-length sequence (tuple, list, ...)
@@ -64,13 +70,6 @@ def merge(left, right, how='left', on=None, left_on=None, right_on=None,
64
70
# TODO: transformations??
65
71
# TODO: only copy DataFrames when modification necessary
66
72
67
- # def join_managers(left, right, axis=1, how='left', copy=True):
68
- # join_index, left_indexer, right_indexer = \
69
- # left.axes[axis].join(right.axes[axis], how=how, return_indexers=True)
70
- # op = _BlockJoinOperation(left, right, join_index, left_indexer,
71
- # right_indexer, axis=axis)
72
- # return op.get_result(copy=copy)
73
-
74
73
class _MergeOperation (object ):
75
74
"""
76
75
0 commit comments