diff --git a/supervised/preprocessing/preprocessing_utils.py b/supervised/preprocessing/preprocessing_utils.py index f4896919..c314e4d3 100644 --- a/supervised/preprocessing/preprocessing_utils.py +++ b/supervised/preprocessing/preprocessing_utils.py @@ -111,6 +111,8 @@ def is_na(x): @staticmethod def get_most_frequent(x): a = x.value_counts() + if a.empty: + return None first = sorted(dict(a).items(), key=lambda x: -x[1])[0] return first[0]