diff --git a/sdc/datatypes/hpat_pandas_series_functions.py b/sdc/datatypes/hpat_pandas_series_functions.py index 36f629a20..12b8b6763 100644 --- a/sdc/datatypes/hpat_pandas_series_functions.py +++ b/sdc/datatypes/hpat_pandas_series_functions.py @@ -1369,7 +1369,7 @@ def hpat_pandas_series_value_counts_str_impl( return hpat_pandas_series_value_counts_str_impl - elif isinstance(self.dtype, types.Number): + elif isinstance(self.dtype, (types.Number, types.Boolean)): series_dtype = self.dtype def hpat_pandas_series_value_counts_number_impl( diff --git a/sdc/tests/test_series.py b/sdc/tests/test_series.py index b562be57d..5e08b9c7b 100644 --- a/sdc/tests/test_series.py +++ b/sdc/tests/test_series.py @@ -2590,6 +2590,20 @@ def test_impl(S): result = hpat_func(S).sort_index() pd.testing.assert_series_equal(result, result_ref) + @skip_sdc_jit('Fails to compile with latest Numba') + def test_series_value_counts_boolean(self): + def test_impl(S): + return S.value_counts() + + input_data = [True, False, True, True, False] + + sdc_func = self.jit(test_impl) + + S = pd.Series(input_data) + result_ref = test_impl(S) + result = sdc_func(S) + pd.testing.assert_series_equal(result, result_ref) + @skip_sdc_jit('Bug in old-style value_counts implementation for ascending param support') def test_series_value_counts_sort(self): def test_impl(S, value):