diff --git a/Orange/statistics/util.py b/Orange/statistics/util.py index 38461e259c8..826362cc2f5 100644 --- a/Orange/statistics/util.py +++ b/Orange/statistics/util.py @@ -447,7 +447,7 @@ def nanunique(*args, **kwargs): result, counts = result non_nan_mask = ~np.isnan(result) return result[non_nan_mask], counts[non_nan_mask] - + return result[~np.isnan(result)] diff --git a/Orange/tests/test_statistics.py b/Orange/tests/test_statistics.py index 7f389aa3262..adaa28fc57a 100644 --- a/Orange/tests/test_statistics.py +++ b/Orange/tests/test_statistics.py @@ -398,6 +398,7 @@ def test_sparse_explicit_zeros(self): @dense_sparse def test_nanunique_ignores_nans_in_values(self, array): + # pylint: disable=bad-whitespace x = array([[-1., 1., 0., 2., 3., np.nan], [ 0., 0., 0., 3., 5., np.nan], [-1., 0., 0., 1., 7., 6.]]) @@ -407,6 +408,7 @@ def test_nanunique_ignores_nans_in_values(self, array): @dense_sparse def test_nanunique_ignores_nans_in_counts(self, array): + # pylint: disable=bad-whitespace x = array([[-1., 1., 0., 2., 3., np.nan], [ 0., 0., 0., 3., 5., np.nan], [-1., 0., 0., 1., 7., 6.]])