(self, idx)
return getitem_by_mask_impl
Creates a new array from arr by selecting elements indicated by Boolean mask idx.

    Parameters
    -----------
    arr: :obj:`Array` or :obj:`Range`
        Input array or range
    idx: :obj:`Array` of dtype :class:`bool`
        Boolean mask

    Returns
    -------
    :obj:`Array` of the same dtype as arr
        Array with only elements indicated by mask left
Creates a new array from arr by selecting elements indicated by Boolean mask idx.
Creates a new array from arr by selecting elements indicated by Boolean mask idx .
def getitem_by_mask_overload(self, idx):
    """
    Creates a new array from arr by selecting elements indicated by Boolean mask idx.

    Parameters
    -----------
    arr: :obj:`Array` or :obj:`Range`
        Input array or range
    idx: :obj:`Array` of dtype :class:`bool`
        Boolean mask

    Returns
    -------
    :obj:`Array` of the same dtype as arr
        Array with only elements indicated by mask left

    """

    valid_self_types = (types.Array,) + sdc_pandas_index_types
    if not isinstance(self, valid_self_types):
        return None

    # for empty index assume it's returns itself
    if isinstance(self, EmptyIndexType):
        def getitem_by_mask_empty_index_impl(self, idx):
            return self
        return getitem_by_mask_empty_index_impl

    res_dtype = self.dtype
    is_str_arr = self == string_array_type
    is_numeric_index = isinstance(self, (PositionalIndexType, RangeIndexType, Int64IndexType))

    def getitem_by_mask_impl(self, idx):
        chunks = parallel_chunks(len(self))
        arr_len = numpy.empty(len(chunks), dtype=numpy.int64)
        length = 0

        for i in prange(len(chunks)):
            chunk = chunks[i]
            res = 0
            for j in range(chunk.start, chunk.stop):
                if idx[j]:
                    res += 1
            length += res
            arr_len[i] = res

        if is_str_arr == True:  # noqa
            result_data = [''] * length
            result_nan_mask = numpy.empty(shape=length, dtype=types.bool_)
        else:
            result_data = numpy.empty(shape=length, dtype=res_dtype)
        for i in prange(len(chunks)):
            chunk = chunks[i]
            new_start = int(sum(arr_len[0:i]))
            current_pos = new_start

            for j in range(chunk.start, chunk.stop):
                if idx[j]:
                    value = self[j]
                    result_data[current_pos] = value
                    if is_str_arr == True:  # noqa
                        result_nan_mask[current_pos] = isna(self, j)
                    current_pos += 1

        if is_str_arr == True:  # noqa
            result_data_as_str_arr = create_str_arr_from_list(result_data)
            str_arr_set_na_by_mask(result_data_as_str_arr, result_nan_mask)
            return result_data_as_str_arr
        elif is_numeric_index == True:  # noqa
            return pandas.Int64Index(result_data, name=self.name)
        else:
            return result_data

    return getitem_by_mask_impl
def getitem_by_mask_overload ( self , idx ) : valid_self_types = ( types . Array , ) + sdc_pandas_index_types if not isinstance ( self , valid_self_types ) : return None # for empty index assume it's returns itself if isinstance ( self , EmptyIndexType ) : def getitem_by_mask_empty_index_impl ( self , idx ) : return self return getitem_by_mask_empty_index_impl res_dtype = self . dtype is_str_arr = self == string_array_type is_numeric_index = isinstance ( self , ( PositionalIndexType , RangeIndexType , Int64IndexType ) ) def getitem_by_mask_impl ( self , idx ) : chunks = parallel_chunks ( len ( self ) ) arr_len = numpy . empty ( len ( chunks ) , dtype = numpy . int64 ) length = 0 for i in prange ( len ( chunks ) ) : chunk = chunks [ i ] res = 0 for j in range ( chunk . start , chunk . stop ) : if idx [ j ] : res += 1 length += res arr_len [ i ] = res if is_str_arr == True : # noqa result_data = [ '' ] * length result_nan_mask = numpy . empty ( shape = length , dtype = types . bool_ ) else : result_data = numpy . empty ( shape = length , dtype = res_dtype ) for i in prange ( len ( chunks ) ) : chunk = chunks [ i ] new_start = int ( sum ( arr_len [ 0 : i ] ) ) current_pos = new_start for j in range ( chunk . start , chunk . stop ) : if idx [ j ] : value = self [ j ] result_data [ current_pos ] = value if is_str_arr == True : # noqa result_nan_mask [ current_pos ] = isna ( self , j ) current_pos += 1 if is_str_arr == True : # noqa result_data_as_str_arr = create_str_arr_from_list ( result_data ) str_arr_set_na_by_mask ( result_data_as_str_arr , result_nan_mask ) return result_data_as_str_arr elif is_numeric_index == True : # noqa return pandas . Int64Index ( result_data , name = self . name ) else : return result_data return getitem_by_mask_impl