@@ -1312,15 +1312,16 @@ def _get_join_indexers(
1312
1312
llab , rlab , shape = [list (x ) for x in zipped ]
1313
1313
1314
1314
# get flat i8 keys from label lists
1315
- print (llab , rlab )
1316
1315
lkey , rkey = _get_join_keys (llab , rlab , shape , sort )
1317
1316
1318
1317
# factorize keys to a dense i8 space
1319
1318
# `count` is the num. of unique keys
1320
1319
# set(lkey) | set(rkey) == range(count)
1321
1320
1322
- print (lkey , rkey )
1323
- lkey , rkey , count = fkeys (lkey , rkey )
1321
+ if how == "right" :
1322
+ rkey , lkey , count = fkeys (rkey , lkey )
1323
+ else :
1324
+ lkey , rkey , count = fkeys (lkey , rkey )
1324
1325
# preserve left frame order if how == 'left' and sort == False
1325
1326
kwargs = copy .copy (kwargs )
1326
1327
if how == "left" :
@@ -1857,22 +1858,8 @@ def _left_join_on_index(left_ax: Index, right_ax: Index, join_keys, sort: bool =
1857
1858
1858
1859
1859
1860
def _right_outer_join (x , y , max_groups ):
1860
- new_x = []
1861
- for i in y :
1862
- if i in x :
1863
- new_x .append (i )
1864
- else :
1865
- new_x .append (- 1 )
1866
-
1867
- return np .array (new_x ), np .array ([0 , 1 , 2 ])
1868
- # right_indexer, left_indexer = libjoin.left_outer_join(y, x, max_groups)
1869
- # print('right_index: ', y, " - ", right_indexer)
1870
- # print('left_index: ', x, " - ", left_indexer)
1871
-
1872
- # assert np.array_equal(left_indexer, np.array([1, 2, -1]))
1873
- # assert np.array_equal(right_indexer, np.array([1, 2, 0]))
1874
- # return np.array([-1, 1, 2]), np.array([0,1,2])
1875
- # return left_indexer, right_indexer
1861
+ right_indexer , left_indexer = libjoin .left_outer_join (y , x , max_groups )
1862
+ return left_indexer , right_indexer
1876
1863
1877
1864
1878
1865
_join_functions = {
0 commit comments