(self, dropna=True)
return hpat_pandas_series_nunique_impl
Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.nunique

    Limitations
    -----------
    - This function may reveal slower performance than Pandas* on user system. Users should exercise a tradeoff
    between staying in JIT-region with that function or going back to interpreter mode.

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_nunique.py
       :language: python
       :lines: 27-
       :caption: Return number of unique elements in the object.
       :name: ex_series_nunique

    .. command-output:: python ./series/series_nunique.py
       :cwd: ../../../examples

    .. seealso::
        :ref:`DataFrame.nunique <pandas.DataFrame.nunique>`
            Method nunique for DataFrame.
        :ref:`Series.count <pandas.Series.count>`
            Count non-NA/null observations in the Series.
        :ref:`DatatFrame.count <pandas.DataFrame.count>`
            Count non-NA cells for each column

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas Series method :meth:`pandas.Series.nunique` implementation.

    .. only:: developer
        Test: python -m sdc.runtests sdc.tests.test_series.TestSeries.test_series_nunique
Intel Scalable Dataframe Compiler User Guide
    ********************************************
Intel Scalable Dataframe Compiler User Guide ********************************************
def hpat_pandas_series_nunique(self, dropna=True):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.nunique

    Limitations
    -----------
    - This function may reveal slower performance than Pandas* on user system. Users should exercise a tradeoff
    between staying in JIT-region with that function or going back to interpreter mode.

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_nunique.py
       :language: python
       :lines: 27-
       :caption: Return number of unique elements in the object.
       :name: ex_series_nunique

    .. command-output:: python ./series/series_nunique.py
       :cwd: ../../../examples

    .. seealso::
        :ref:`DataFrame.nunique <pandas.DataFrame.nunique>`
            Method nunique for DataFrame.
        :ref:`Series.count <pandas.Series.count>`
            Count non-NA/null observations in the Series.
        :ref:`DatatFrame.count <pandas.DataFrame.count>`
            Count non-NA cells for each column

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas Series method :meth:`pandas.Series.nunique` implementation.

    .. only:: developer
        Test: python -m sdc.runtests sdc.tests.test_series.TestSeries.test_series_nunique
    """

    _func_name = 'Method nunique().'

    ty_checker = TypeChecker(_func_name)
    ty_checker.check(self, SeriesType)

    if isinstance(self.data, StringArrayType):
        def hpat_pandas_series_nunique_str_impl(self, dropna=True):
            """
            It is better to merge with Numeric branch
            """
            data = self._data
            if dropna:
                nan_mask = self.isna()
                data = self._data[~nan_mask._data]
            unique_values = build_set(data)
            return len(unique_values)

        return hpat_pandas_series_nunique_str_impl

    def hpat_pandas_series_nunique_impl(self, dropna=True):
        """
        This function for Numeric data because NumPy dosn't support StringArrayType
        Algo looks a bit ambigous because, currently, set() can not be used with NumPy with Numba JIT
        """
        data_mask_for_nan = numpy.isnan(self._data)
        nan_exists = numpy.any(data_mask_for_nan)
        data_no_nan = self._data[~data_mask_for_nan]
        data_set = build_set(data_no_nan)
        if dropna or not nan_exists:
            return len(data_set)
        else:
            return len(data_set) + 1

    return hpat_pandas_series_nunique_impl
def hpat_pandas_series_nunique ( self , dropna = True ) : _func_name = 'Method nunique().' ty_checker = TypeChecker ( _func_name ) ty_checker . check ( self , SeriesType ) if isinstance ( self . data , StringArrayType ) : def hpat_pandas_series_nunique_str_impl ( self , dropna = True ) : """
            It is better to merge with Numeric branch
            """ data = self . _data if dropna : nan_mask = self . isna ( ) data = self . _data [ ~ nan_mask . _data ] unique_values = build_set ( data ) return len ( unique_values ) return hpat_pandas_series_nunique_str_impl def hpat_pandas_series_nunique_impl ( self , dropna = True ) : """
        This function for Numeric data because NumPy dosn't support StringArrayType
        Algo looks a bit ambigous because, currently, set() can not be used with NumPy with Numba JIT
        """ data_mask_for_nan = numpy . isnan ( self . _data ) nan_exists = numpy . any ( data_mask_for_nan ) data_no_nan = self . _data [ ~ data_mask_for_nan ] data_set = build_set ( data_no_nan ) if dropna or not nan_exists : return len ( data_set ) else : return len ( data_set ) + 1 return hpat_pandas_series_nunique_impl