Skip to content

Commit

Permalink
handles unicode errors when checking for bad vals in y
Browse files Browse the repository at this point in the history
  • Loading branch information
ClimbsRocks committed Nov 9, 2017
1 parent 8093ca2 commit 75d78f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion auto_ml/utils.py
Expand Up @@ -131,7 +131,13 @@ def drop_missing_y_vals(df, y, output_column=None):
indices_to_drop = []
indices_to_keep = []
for idx, val in enumerate(y):
if str(val) in bad_vals_as_strings:
if not isinstance(val, str):
if isinstance(val, numbers.Number) or val is None:
val = str(val)
else:
val = val.encode('utf-8').decode('utf-8')

if val in bad_vals_as_strings:
indices_to_drop.append(idx)

if len(indices_to_drop) > 0:
Expand Down

0 comments on commit 75d78f1

Please sign in to comment.