data = filter(lambda x: len(x) > 0, line.strip().split(delimiter))
if len(data) > 2:
data[2:] = delimiter.join(data[2:])
if len(data) == 1:
times.append(converter(data[0]))
labels.append("%s%d" % (label_prefix, row))
After Change
times = []
labels = []
splitter = re.compile(delimiter)
with open(filename, "r") as input_file:
for row, line in enumerate(input_file, 1):
data = splitter.split(line.strip(), 1)