for index, row in train_set.iterrows ():
S = str(row[""])
M = re.finditer(match_target, S)
part_index_list = [(m.start(), m.start() + len(m.group()) - 1) for m in M]
part_list = [m.group() for m in M]
After run, the part_index_list list has a normal value, and part_list has been empty all the time. Theoretically, part_index_list should be corresponding to part_list, empty or non-empty at the same time. The result seems to be unscientific.