(self, n=5, keep='first')
return hpat_pandas_series_nsmallest_impl
Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.nsmallest

    Limitations
    -----------
    - Parameter ``keep`` is supported only with default value ``'first'``.
    - 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_nsmallest.py
       :language: python
       :lines: 27-
       :caption: Returns the smallest n elements.
       :name: ex_series_nsmallest

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

    .. seealso::

        :ref:`Series.nlargest <pandas.Series.nlargest>`
            Get the n largest elements.

        :ref:`Series.sort_values <pandas.Series.sort_values>`
            Sort Series by values.

        :ref:`Series.head <pandas.Series.head>`
            Return the first n rows.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************

    Pandas Series method :meth:`pandas.Series.nsmallest` implementation.

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_nsmallest*
Intel Scalable Dataframe Compiler User Guide
    ********************************************
Intel Scalable Dataframe Compiler User Guide ********************************************
def hpat_pandas_series_nsmallest(self, n=5, keep='first'):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.nsmallest

    Limitations
    -----------
    - Parameter ``keep`` is supported only with default value ``'first'``.
    - 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_nsmallest.py
       :language: python
       :lines: 27-
       :caption: Returns the smallest n elements.
       :name: ex_series_nsmallest

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

    .. seealso::

        :ref:`Series.nlargest <pandas.Series.nlargest>`
            Get the n largest elements.

        :ref:`Series.sort_values <pandas.Series.sort_values>`
            Sort Series by values.

        :ref:`Series.head <pandas.Series.head>`
            Return the first n rows.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************

    Pandas Series method :meth:`pandas.Series.nsmallest` implementation.

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_nsmallest*
    """

    _func_name = 'Method nsmallest().'

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

    if not isinstance(n, (types.Omitted, int, types.Integer)):
        ty_checker.raise_exc(n, 'int', 'n')

    if not isinstance(keep, (types.Omitted, str, types.UnicodeType, types.StringLiteral)):
        ty_checker.raise_exc(keep, 'str', 'keep')

    def hpat_pandas_series_nsmallest_impl(self, n=5, keep='first'):
        if keep != 'first':
            raise ValueError("Method nsmallest(). Unsupported parameter. Given 'keep' != 'first'")

        # mergesort is used for stable sorting of repeated values
        indices = numpy_like.argsort(self._data, kind='mergesort')[:max(n, 0)]

        return self.take(indices)

    return hpat_pandas_series_nsmallest_impl
def hpat_pandas_series_nsmallest ( self , n = 5 , keep = 'first' ) : _func_name = 'Method nsmallest().' ty_checker = TypeChecker ( _func_name ) ty_checker . check ( self , SeriesType ) if not isinstance ( n , ( types . Omitted , int , types . Integer ) ) : ty_checker . raise_exc ( n , 'int' , 'n' ) if not isinstance ( keep , ( types . Omitted , str , types . UnicodeType , types . StringLiteral ) ) : ty_checker . raise_exc ( keep , 'str' , 'keep' ) def hpat_pandas_series_nsmallest_impl ( self , n = 5 , keep = 'first' ) : if keep != 'first' : raise ValueError ( "Method nsmallest(). Unsupported parameter. Given 'keep' != 'first'" ) # mergesort is used for stable sorting of repeated values indices = numpy_like . argsort ( self . _data , kind = 'mergesort' ) [ : max ( n , 0 ) ] return self . take ( indices ) return hpat_pandas_series_nsmallest_impl