(A, kind='quicksort', ascending=True)
return None
Function providing pandas argsort implementation for different 1D array types
Function providing pandas argsort implementation for different 1D array types
Function providing pandas argsort implementation for different 1D array types
def sdc_arrays_argsort_overload(A, kind='quicksort', ascending=True):
    """Function providing pandas argsort implementation for different 1D array types"""

    # kind is not known at compile time, so get this function here and use in impl if needed
    quicksort_func = quicksort.make_jit_quicksort().run_quicksort

    kind_is_default = isinstance(kind, str)
    if isinstance(A, types.Array):
        def _sdc_arrays_argsort_array_impl(A, kind='quicksort', ascending=True):
            _kind = 'quicksort' if kind_is_default == True else kind  # noqa
            return numpy_like.argsort(A, kind=_kind, ascending=ascending)

        return _sdc_arrays_argsort_array_impl

    elif A == string_array_type:
        def _sdc_arrays_argsort_str_arr_impl(A, kind='quicksort', ascending=True):

            if kind == 'quicksort':
                indexes = numpy.arange(len(A))
                data_index_pairs = list(zip(list(A), list(indexes)))
                zipped = quicksort_func(data_index_pairs)
                argsorted = [zipped[i][1] for i in indexes]
                res = numpy.array(argsorted, dtype=numpy.int64)
                # for non-stable sort the order within groups does not matter
                # so just reverse the result when sorting in descending order
                if not ascending:
                    res = res[::-1]
            elif kind == 'mergesort':
                res = str_arr_stable_argosort(A, ascending=ascending)
            else:
                raise ValueError("Unrecognized kind of sort in sdc_arrays_argsort")

            return res

        return _sdc_arrays_argsort_str_arr_impl

    elif isinstance(A, types.List):
        return None

    return None
def sdc_arrays_argsort_overload ( A , kind = 'quicksort' , ascending = True ) : # kind is not known at compile time, so get this function here and use in impl if needed quicksort_func = quicksort . make_jit_quicksort ( ) . run_quicksort kind_is_default = isinstance ( kind , str ) if isinstance ( A , types . Array ) : def _sdc_arrays_argsort_array_impl ( A , kind = 'quicksort' , ascending = True ) : _kind = 'quicksort' if kind_is_default == True else kind # noqa return numpy_like . argsort ( A , kind = _kind , ascending = ascending ) return _sdc_arrays_argsort_array_impl elif A == string_array_type : def _sdc_arrays_argsort_str_arr_impl ( A , kind = 'quicksort' , ascending = True ) : if kind == 'quicksort' : indexes = numpy . arange ( len ( A ) ) data_index_pairs = list ( zip ( list ( A ) , list ( indexes ) ) ) zipped = quicksort_func ( data_index_pairs ) argsorted = [ zipped [ i ] [ 1 ] for i in indexes ] res = numpy . array ( argsorted , dtype = numpy . int64 ) # for non-stable sort the order within groups does not matter # so just reverse the result when sorting in descending order if not ascending : res = res [ : : - 1 ] elif kind == 'mergesort' : res = str_arr_stable_argosort ( A , ascending = ascending ) else : raise ValueError ( "Unrecognized kind of sort in sdc_arrays_argsort" ) return res return _sdc_arrays_argsort_str_arr_impl elif isinstance ( A , types . List ) : return None return None