From 5094ede309bbf04fef4e38f5880eef160dae95cb Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 29 Sep 2020 19:21:37 +0300 Subject: [PATCH] Don't add pandas artifact unnamed:0 column, return original pandas object. --- trains/binding/artifacts.py | 4 +++- trains/logger.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/trains/binding/artifacts.py b/trains/binding/artifacts.py index 00a46596..192866f1 100644 --- a/trains/binding/artifacts.py +++ b/trains/binding/artifacts.py @@ -154,8 +154,10 @@ class Artifact(object): # noinspection PyProtectedMember if self.type == 'numpy' and np: self._object = np.load(local_file)[self.name] - elif self.type in ('pandas', Artifacts._pd_artifact_type) and pd: + elif self.type == Artifacts._pd_artifact_type and pd: self._object = pd.read_csv(local_file) + elif self.type == 'pandas' and pd: + self._object = pd.read_csv(local_file, index_col=[0]) elif self.type == 'image': self._object = Image.open(local_file) elif self.type == 'JSON': diff --git a/trains/logger.py b/trains/logger.py index 626ebc74..7567320b 100644 --- a/trains/logger.py +++ b/trains/logger.py @@ -309,9 +309,9 @@ class Logger(object): "please install the pandas python package" ) if url: - table = pd.read_csv(url) + table = pd.read_csv(url, index_col=[0]) elif csv: - table = pd.read_csv(csv) + table = pd.read_csv(csv, index_col=[0]) def replace(dst, *srcs): for src in srcs: