Table artifact to pandas dataframe

I logged a table artifact.
Now I want to analyze it using pd.DataFrame.

I’ve downloaded the artifact.
However, I don’t mange to convert the json into dataframe.
Is there a method for doing so?
Thanks

import wandb
import pandas as pd
import os.path as osp

run = wandb.init()
artifact = run.use_artifact('PATH/run-1n4emfxy-test_table:v19', type='run_table')
artifact_dir = artifact.download()
path_to_json = osp.join( next(iter(artifact._download_roots)), 'test_table.table.json')
pd.read_json(path_to_json)

Hey Koby, sorry about the delay on this. At the moment the workaround is the following:

table = run.use_artifact("run-<run-id>-<table-name>:<tag>").get("<table-name>")
df = pd.DataFrame(data=table.data, columns=table.columns)

Best,
Arman

1 Like

Hi Koby,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Best,
Weights & Biases

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.