From f6f342cb1f0c35e65afb5164fd12919806409ffa Mon Sep 17 00:00:00 2001 From: hackermike <33561537+hackermike@users.noreply.github.com> Date: Tue, 8 Sep 2020 17:22:09 -0600 Subject: [PATCH] Fix bug if X is a DataFrame with 2 columns. --- xverse/transformer/_woe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xverse/transformer/_woe.py b/xverse/transformer/_woe.py index b13746b..396763a 100644 --- a/xverse/transformer/_woe.py +++ b/xverse/transformer/_woe.py @@ -110,7 +110,10 @@ def fit(self, X, y): #if the function is used as part of pipeline, then try to unpack tuple values #produced in the previous step. Added as a part of pipeline feature. try: - X, y = X + # If X is a DataFrame with 2 features, the assignment would succeed + # but not be as intended. + if not isinstance(X, pd.DataFrame): + X, y = X except: pass