table을 artifact로 변환하기
artifact.get(table, "table_name")를 사용하는 것입니다.
artifact를 데이터프레임으로 변환
데이터 내보내기
다음 단계
artifacts에 대한 레퍼런스 문서를 확인해 보세요.- Tables Walkthrough 가이드를 살펴보세요.
- DataFrame 레퍼런스 문서를 참고하세요.
테이블에서 데이터 내보내는 방법
table을 artifact로 변환하기artifact.get(table, "table_name")를 사용하는 것입니다.
# 새 테이블을 생성하고 로그합니다.
with wandb.init() as r:
artifact = wandb.Artifact("my_dataset", type="dataset")
table = wandb.Table(
columns=["a", "b", "c"], data=[(i, i * 2, 2**i) for i in range(10)]
)
artifact.add(table, "my_table")
wandb.log_artifact(artifact)
# 생성한 아티팩트를 사용하여 테이블을 가져옵니다.
with wandb.init() as r:
artifact = r.use_artifact("my_dataset:latest")
table = artifact.get("my_table")
artifact를 데이터프레임으로 변환# 앞의 코드 예제에 이어서:
df = table.get_dataframe()
# 테이블 데이터를 .csv로 변환
df.to_csv("example.csv", encoding="utf-8")
artifacts에 대한 레퍼런스 문서를 확인해 보세요.