Skip to content

Commit 688f6e1

Browse files
author
Nico Cernek
committed
broken commit with a bunch of print statements and comments
1 parent 10cc186 commit 688f6e1

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

pandas/core/reshape/merge.py

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,13 @@ def __init__(
553553
indicator=False,
554554
validate=None,
555555
):
556+
557+
# if how == "right":
558+
# left, right = right, left
559+
# left_index, right_index = right_index, left_index
560+
# left_on, right_on = right_on, left_on
561+
# how = "left"
562+
556563
left = validate_operand(left)
557564
right = validate_operand(right)
558565
self.left = self.orig_left = left
@@ -1282,18 +1289,21 @@ def _get_join_indexers(left_keys, right_keys, sort=False, how="inner", **kwargs)
12821289

12831290
# bind `sort` arg. of _factorize_keys
12841291
fkeys = partial(_factorize_keys, sort=sort)
1285-
1292+
print(left_keys, right_keys)
12861293
# get left & right join labels and num. of levels at each location
12871294
llab, rlab, shape = map(list, zip(*map(fkeys, left_keys, right_keys)))
12881295

12891296
# get flat i8 keys from label lists
1297+
print(llab, rlab)
12901298
lkey, rkey = _get_join_keys(llab, rlab, shape, sort)
12911299

12921300
# factorize keys to a dense i8 space
12931301
# `count` is the num. of unique keys
12941302
# set(lkey) | set(rkey) == range(count)
1295-
lkey, rkey, count = fkeys(lkey, rkey)
12961303

1304+
print(lkey, rkey)
1305+
lkey, rkey, count = fkeys(lkey, rkey)
1306+
print(lkey, rkey)
12971307
# preserve left frame order if how == 'left' and sort == False
12981308
kwargs = copy.copy(kwargs)
12991309
if how == "left":
@@ -1822,8 +1832,22 @@ def _left_join_on_index(left_ax, right_ax, join_keys, sort=False):
18221832

18231833

18241834
def _right_outer_join(x, y, max_groups):
1825-
right_indexer, left_indexer = libjoin.left_outer_join(y, x, max_groups)
1826-
return left_indexer, right_indexer
1835+
new_x = []
1836+
for i in y:
1837+
if i in x:
1838+
new_x.append(i)
1839+
else:
1840+
new_x.append(-1)
1841+
1842+
return np.array(new_x), np.array([0, 1, 2])
1843+
# right_indexer, left_indexer = libjoin.left_outer_join(y, x, max_groups)
1844+
# print('right_index: ', y, " - ", right_indexer)
1845+
# print('left_index: ', x, " - ", left_indexer)
1846+
1847+
# assert np.array_equal(left_indexer, np.array([1, 2, -1]))
1848+
# assert np.array_equal(right_indexer, np.array([1, 2, 0]))
1849+
# return np.array([-1, 1, 2]), np.array([0,1,2])
1850+
# return left_indexer, right_indexer
18271851

18281852

18291853
_join_functions = {

0 commit comments

Comments
 (0)