mirror of
https://github.com/clearml/clearml
synced 2025-02-11 23:33:21 +00:00
Fix pandas DataFrame artifacts with hierarchical indices get mangled by the CSV roundtrip
This commit is contained in:
parent
f48d9d5a91
commit
65ffe9d81f
@ -464,6 +464,10 @@ class Artifacts(object):
|
|||||||
artifact_type_data.content_type = "text/csv"
|
artifact_type_data.content_type = "text/csv"
|
||||||
np.savetxt(local_filename, artifact_object, delimiter=",")
|
np.savetxt(local_filename, artifact_object, delimiter=",")
|
||||||
delete_after_upload = True
|
delete_after_upload = True
|
||||||
|
elif pd and isinstance(artifact_object, pd.DataFrame) \
|
||||||
|
and (isinstance(artifact_object.index, pd.MultiIndex) or
|
||||||
|
isinstance(artifact_object.columns, pd.MultiIndex)):
|
||||||
|
store_as_pickle = True
|
||||||
elif pd and isinstance(artifact_object, pd.DataFrame):
|
elif pd and isinstance(artifact_object, pd.DataFrame):
|
||||||
artifact_type = "pandas"
|
artifact_type = "pandas"
|
||||||
artifact_type_data.preview = preview or str(artifact_object.__repr__())
|
artifact_type_data.preview = preview or str(artifact_object.__repr__())
|
||||||
|
Loading…
Reference in New Issue
Block a user