(usecase)
return impl
Generate series.str.lstrip/rstrip/strip implementations based on usecase func
Generate series.str.lstrip/rstrip/strip implementations based on usecase func
Generate series . str . lstrip / rstrip / strip implementations based on usecase func
def gen_sdc_pandas_series_str_strip_impl(usecase):
    """Generate series.str.lstrip/rstrip/strip implementations based on usecase func"""
    def impl(self, to_strip=None):
        mask = get_nan_mask(self._data._data)
        item_count = len(self._data)
        res_list = [''] * item_count

        for it in range(item_count):
            item = self._data._data[it]
            if len(item) > 0:
                res_list[it] = usecase(item, to_strip)
            else:
                res_list[it] = item

        str_arr = create_str_arr_from_list(res_list)
        result = str_arr_set_na_by_mask(str_arr, mask)

        return pandas.Series(result, self._data._index, name=self._data._name)

    return impl
def gen_sdc_pandas_series_str_strip_impl ( usecase ) : def impl ( self , to_strip = None ) : mask = get_nan_mask ( self . _data . _data ) item_count = len ( self . _data ) res_list = [ '' ] * item_count for it in range ( item_count ) : item = self . _data . _data [ it ] if len ( item ) > 0 : res_list [ it ] = usecase ( item , to_strip ) else : res_list [ it ] = item str_arr = create_str_arr_from_list ( res_list ) result = str_arr_set_na_by_mask ( str_arr , mask ) return pandas . Series ( result , self . _data . _index , name = self . _data . _name ) return impl