def remove_error_poi_each_line(line_data):
## from 1 to len(..), because the first one is district hash
### why I need a temp_line_data here!!!!
### Please see the property of the remove() function
standard_style = re.compile(r"\d+#\d+:\d+")
line_data = list(line_data[0])
temp_line_data = line_data.copy()
for poi_in_line in temp_line_data:
if len(poi_in_line) == 32: # this is the district hash
continue
if not re.match(standard_style, poi_in_line):
#print(poi_in_line)
line_data.remove(poi_in_line)
return pd.Series([line_data])
# the input line_data is a serise!!
评论列表
文章目录