Fix bug.
This commit is contained in:
Родитель
09bc6e6a63
Коммит
655f8e6444
|
@ -43,8 +43,8 @@ def round_sample_strat(X, strat, **kwargs):
|
|||
def random_merge(A, B, N=20, on='AnswerId', key='key', n='n'):
|
||||
"""Pair all rows of A with 1 matching row on "on" and N-1 random rows from B
|
||||
"""
|
||||
if key not in A and key not in B:
|
||||
raise KeyError('key is either not in A or not in B')
|
||||
if key in A or key in B:
|
||||
raise KeyError('key {} is either in A or in B'.format(key))
|
||||
X = A.copy()
|
||||
X[key] = A[on]
|
||||
Y = B.copy()
|
||||
|
|
Загрузка…
Ссылка в новой задаче