Beispiel #1
0
    def hpat_pandas_stringmethods_casefold_impl(self):
        mask = get_nan_mask(self._data._data)
        item_count = len(self._data)
        res_list = [''] * item_count
        for idx in numba.prange(item_count):
            res_list[idx] = self._data._data[idx].casefold()
        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)
    def hpat_pandas_stringmethods_upper_impl(self):
        mask = get_nan_mask(self._data._data)
        item_count = len(self._data)
        result = [''] * item_count

        for it in numba.prange(item_count):
            item = self._data._data[it]
            if len(item) > 0:
                result[it] = item.upper()
            else:
                result[it] = item

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

        return pandas.Series(result, self._data._index, name=self._data._name)
    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)