Don't add pandas artifact unnamed:0 column, return original pandas object.

This commit is contained in:
allegroai 2020-09-29 19:21:37 +03:00
parent 30a08ee937
commit 5094ede309
2 changed files with 5 additions and 3 deletions

View File

@ -154,8 +154,10 @@ class Artifact(object):
# noinspection PyProtectedMember # noinspection PyProtectedMember
if self.type == 'numpy' and np: if self.type == 'numpy' and np:
self._object = np.load(local_file)[self.name] 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) 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': elif self.type == 'image':
self._object = Image.open(local_file) self._object = Image.open(local_file)
elif self.type == 'JSON': elif self.type == 'JSON':

View File

@ -309,9 +309,9 @@ class Logger(object):
"please install the pandas python package" "please install the pandas python package"
) )
if url: if url:
table = pd.read_csv(url) table = pd.read_csv(url, index_col=[0])
elif csv: elif csv:
table = pd.read_csv(csv) table = pd.read_csv(csv, index_col=[0])
def replace(dst, *srcs): def replace(dst, *srcs):
for src in srcs: for src in srcs: