> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-feat-cli-docs-generator.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# テーブル データをエクスポート

> テーブルからデータをエクスポートする方法。

すべての W\&B Artifacts 同様に、Tables は pandas データフレームに変換して、データのエクスポートを簡単に行うことができます。

## `table` を `artifact` に変換する

まず、テーブルをアーティファクトに変換する必要があります。これを行う最も簡単な方法は `artifact.get(table, "table_name")` を使用することです：

```python theme={null}
# 新しいテーブルを作成してログします。
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` をデータフレームに変換する

次に、テーブルをデータフレームに変換します：

```python theme={null}
# 前のコード例から続けて：
df = table.get_dataframe()
```

## データをエクスポート

現在、データフレームがサポートする任意のメソッドを使用してエクスポートできます：

```python theme={null}
# テーブルデータを .csv に変換
df.to_csv("example.csv", encoding="utf-8")
```

# 次のステップ

* `artifacts` に関する [リファレンスドキュメント](/ja/models/artifacts/construct-an-artifact/) をチェックしてください。
* [Tables Walkthrough](/ja/models/tables/tables-walkthrough/) ガイドを確認してください。
* [データフレーム](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) リファレンスドキュメントを参照してください。
