From 85eea4a87ed8674d187a2b2d48f51f57efec9a75 Mon Sep 17 00:00:00 2001 From: Quillot Mathias Date: Wed, 28 Apr 2021 21:08:19 +0200 Subject: [PATCH] A space was needed when no values was given to the write_line function --- volia/core/data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/volia/core/data.py b/volia/core/data.py index 300b266..d22e8bc 100644 --- a/volia/core/data.py +++ b/volia/core/data.py @@ -104,4 +104,7 @@ def write_line(id_, values=[], out=sys.stdout): values (list, optional): list of values to write, features or labels. Defaults to []. out (_io.TextIOWrapper, optional): . Defaults to sys.stdout. """ - out.write(str(id_) + " ".join(values) + "\n") \ No newline at end of file + if len(values) == 0: + out.write(str(id_) + "\n") + else: + out.write(str(id_) + " " + " ".join(values) + "\n") \ No newline at end of file -- 1.8.2.3