diff --git a/setup.py b/setup.py index e84e792..5dca904 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='mdatagen', - version='0.1.62', + version='0.1.63', keywords=['machine learning', 'preprocessing data'], packages=find_packages(where="src"), package_dir={"": "src"}, diff --git a/src/mdatagen/utils/feature_choice.py b/src/mdatagen/utils/feature_choice.py index 15cb9f6..e32e46d 100644 --- a/src/mdatagen/utils/feature_choice.py +++ b/src/mdatagen/utils/feature_choice.py @@ -176,7 +176,13 @@ def miss_locations(ordered_id, threshold, N): highest = [] if threshold == 0 else ordered_id[round(-threshold * N) :] if isinstance(ordered_id, pd.Series): - pos_xmiss = np.hstack([lowest.index, highest.index]) + if len(lowest) == 0: + pos_xmiss = np.hstack([lowest, highest.index]) + elif len(highest) == 0: + pos_xmiss = np.hstack([lowest.index, highest]) + else: + pos_xmiss = np.hstack([lowest.index, highest.index]) + elif isinstance(ordered_id, np.ndarray): pos_xmiss = np.hstack([lowest, highest]) else: