(self, axis=0, kind='quicksort', order=None)
return hpat_pandas_series_argsort_noidx_impl
Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.argsort

    Limitations
    -----------
    - Parameter ``axis`` is supported only with default value ``0``.
    - Parameter ``order`` is supported only with default value ``None``.
    - Parameter ``kind`` is supported only with values ``'mergesort'`` and ``'quicksort'``.
    - 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_argsort.py
       :language: python
       :lines: 27-
       :caption: Override ndarray.argsort.
       :name: ex_series_argsort

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

    .. seealso::

        `numpy.ndarray.argsort
        <https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.argsort.html#numpy.ndarray.argsort>`_
            Return indices of the minimum values along the given axis.

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

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_argsort*
Intel Scalable Dataframe Compiler User Guide
    ********************************************
Intel Scalable Dataframe Compiler User Guide ********************************************
def hpat_pandas_series_argsort(self, axis=0, kind='quicksort', order=None):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.argsort

    Limitations
    -----------
    - Parameter ``axis`` is supported only with default value ``0``.
    - Parameter ``order`` is supported only with default value ``None``.
    - Parameter ``kind`` is supported only with values ``'mergesort'`` and ``'quicksort'``.
    - 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_argsort.py
       :language: python
       :lines: 27-
       :caption: Override ndarray.argsort.
       :name: ex_series_argsort

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

    .. seealso::

        `numpy.ndarray.argsort
        <https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.argsort.html#numpy.ndarray.argsort>`_
            Return indices of the minimum values along the given axis.

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

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

    _func_name = 'Method argsort().'

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

    if not isinstance(self.data.dtype, types.Number):
        ty_checker.raise_exc(self.data.dtype, 'int, float', 'self.data.dtype')

    if not (isinstance(axis, types.Omitted) or isinstance(axis, types.Integer) or axis == 0):
        ty_checker.raise_exc(axis, 'int64', 'axis')

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

    if not isinstance(order, (str, types.UnicodeType, types.StringLiteral, types.Omitted, types.NoneType, types.List))\
            and order is not None:
        ty_checker.raise_exc(order, 'None', 'order')

    if not isinstance(self.index, PositionalIndexType):
        def hpat_pandas_series_argsort_idx_impl(self, axis=0, kind='quicksort', order=None):
            series_data = self._data  # FIXME_Numba#6960
            if kind != 'quicksort' and kind != 'mergesort':
                raise ValueError("Method argsort(). Unsupported parameter. Given 'kind' != 'quicksort' or 'mergesort'")
            if kind == 'mergesort':
                #It is impossible to use numpy.argsort(self._data, kind=kind) since numba gives typing error
                sort = numpy_like.argsort(series_data, kind='mergesort')
            else:
                sort = numpy_like.argsort(series_data)
            na = self.isna().sum()
            result = numpy.empty(len(series_data), dtype=numpy.int64)
            na_data_arr = sdc.hiframes.api.get_nan_mask(series_data)
            if kind == 'mergesort':
                sort_nona = numpy_like.argsort(series_data[~na_data_arr], kind='mergesort')
            else:
                sort_nona = numpy_like.argsort(series_data[~na_data_arr])
            q = 0
            for id, i in enumerate(sort):
                if id in set(sort[len(series_data) - na:]):
                    q += 1
                else:
                    result[id] = sort_nona[id - q]
            for i in sort[len(series_data) - na:]:
                result[i] = -1

            return pandas.Series(result, self._index)

        return hpat_pandas_series_argsort_idx_impl

    def hpat_pandas_series_argsort_noidx_impl(self, axis=0, kind='quicksort', order=None):
        series_data = self._data  # FIXME_Numba#6960
        if kind != 'quicksort' and kind != 'mergesort':
            raise ValueError("Method argsort(). Unsupported parameter. Given 'kind' != 'quicksort' or 'mergesort'")
        if kind == 'mergesort':
            sort = numpy_like.argsort(series_data, kind='mergesort')
        else:
            sort = numpy_like.argsort(series_data)
        na = self.isna().sum()
        result = numpy.empty(len(series_data), dtype=numpy.int64)
        na_data_arr = sdc.hiframes.api.get_nan_mask(series_data)
        if kind == 'mergesort':
            sort_nona = numpy_like.argsort(series_data[~na_data_arr], kind='mergesort')
        else:
            sort_nona = numpy_like.argsort(series_data[~na_data_arr])
        q = 0
        for id, i in enumerate(sort):
            if id in set(sort[len(series_data) - na:]):
                q += 1
            else:
                result[id] = sort_nona[id - q]
        for i in sort[len(series_data) - na:]:
            result[i] = -1

        return pandas.Series(result)

    return hpat_pandas_series_argsort_noidx_impl
def hpat_pandas_series_argsort ( self , axis = 0 , kind = 'quicksort' , order = None ) : _func_name = 'Method argsort().' ty_checker = TypeChecker ( _func_name ) ty_checker . check ( self , SeriesType ) if not isinstance ( self . data . dtype , types . Number ) : ty_checker . raise_exc ( self . data . dtype , 'int, float' , 'self.data.dtype' ) if not ( isinstance ( axis , types . Omitted ) or isinstance ( axis , types . Integer ) or axis == 0 ) : ty_checker . raise_exc ( axis , 'int64' , 'axis' ) if not isinstance ( kind , ( types . Omitted , str , types . UnicodeType , types . StringLiteral ) ) : ty_checker . raise_exc ( kind , 'quicksort' , 'kind' ) if not isinstance ( order , ( str , types . UnicodeType , types . StringLiteral , types . Omitted , types . NoneType , types . List ) ) and order is not None : ty_checker . raise_exc ( order , 'None' , 'order' ) if not isinstance ( self . index , PositionalIndexType ) : def hpat_pandas_series_argsort_idx_impl ( self , axis = 0 , kind = 'quicksort' , order = None ) : series_data = self . _data # FIXME_Numba#6960 if kind != 'quicksort' and kind != 'mergesort' : raise ValueError ( "Method argsort(). Unsupported parameter. Given 'kind' != 'quicksort' or 'mergesort'" ) if kind == 'mergesort' : #It is impossible to use numpy.argsort(self._data, kind=kind) since numba gives typing error sort = numpy_like . argsort ( series_data , kind = 'mergesort' ) else : sort = numpy_like . argsort ( series_data ) na = self . isna ( ) . sum ( ) result = numpy . empty ( len ( series_data ) , dtype = numpy . int64 ) na_data_arr = sdc . hiframes . api . get_nan_mask ( series_data ) if kind == 'mergesort' : sort_nona = numpy_like . argsort ( series_data [ ~ na_data_arr ] , kind = 'mergesort' ) else : sort_nona = numpy_like . argsort ( series_data [ ~ na_data_arr ] ) q = 0 for id , i in enumerate ( sort ) : if id in set ( sort [ len ( series_data ) - na : ] ) : q += 1 else : result [ id ] = sort_nona [ id - q ] for i in sort [ len ( series_data ) - na : ] : result [ i ] = - 1 return pandas . Series ( result , self . _index ) return hpat_pandas_series_argsort_idx_impl def hpat_pandas_series_argsort_noidx_impl ( self , axis = 0 , kind = 'quicksort' , order = None ) : series_data = self . _data # FIXME_Numba#6960 if kind != 'quicksort' and kind != 'mergesort' : raise ValueError ( "Method argsort(). Unsupported parameter. Given 'kind' != 'quicksort' or 'mergesort'" ) if kind == 'mergesort' : sort = numpy_like . argsort ( series_data , kind = 'mergesort' ) else : sort = numpy_like . argsort ( series_data ) na = self . isna ( ) . sum ( ) result = numpy . empty ( len ( series_data ) , dtype = numpy . int64 ) na_data_arr = sdc . hiframes . api . get_nan_mask ( series_data ) if kind == 'mergesort' : sort_nona = numpy_like . argsort ( series_data [ ~ na_data_arr ] , kind = 'mergesort' ) else : sort_nona = numpy_like . argsort ( series_data [ ~ na_data_arr ] ) q = 0 for id , i in enumerate ( sort ) : if id in set ( sort [ len ( series_data ) - na : ] ) : q += 1 else : result [ id ] = sort_nona [ id - q ] for i in sort [ len ( series_data ) - na : ] : result [ i ] = - 1 return pandas . Series ( result ) return hpat_pandas_series_argsort_noidx_impl