def __join_key_id(self, row_series): resu = [] for k in self.key_index: if self.xlmap is None: resu.append(transType(row_series[k])) else: if self.xlmap.show[k] is not None: resu.append(transType(row_series[k])) else: pass continue return '-'.join(resu)
def __parse_str_match(self, condition_row, row_series): # print('str',condition_row) regitem = condition_row[0] compare_col = condition_row[1] if_regex = condition_row[2] match_type = condition_row[3] if compare_col not in row_series.index: return False else: compare_item = str(row_series[compare_col]) if if_regex == False: return regitem == compare_item else: # if_regex == True regitem = transType(regitem) regitem = re.compile(regitem) if match_type == True: # match mode; b = re.match(regitem, compare_item) else: # match_type == False, search mode; b = re.search(regitem, compare_item) if b is not None: return True else: return False
def top_accna_apply_func(row_series): accna=transType(row_series[self.accna_col]) top_accna=accna.split(self.accna_split_by)[0] top_accna=str(top_accna) return top_accna
def top_accid_apply_func(row_series): accid=transType(row_series[self.accid_col]) to_accid_len=self.top_accid_len top_accid=accid[0:to_accid_len] return top_accid
def trans_accid_to_str(row_series): accid_str=transType(row_series[self.accid_col]) return accid_str
def trans_row_dtype(row_series): return transType(row_series[col_name])