> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

> オフラインでの分析やデータ処理のために、W&B 表のデータを pandas データフレームや CSV ファイルにエクスポートします。

# 表データをエクスポートする

他の W\&B Artifacts と同様に、Tables は pandas データフレームに変換できるため、データを簡単にエクスポートできます。

<h2 id="convert-table-to-artifact">
  `table` を `artifact` に変換する
</h2>

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

```python theme={"system"}
# 新しい表を作成してログします。
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")
```

<h2 id="convert-artifact-to-dataframe">
  `artifact` をデータフレームに変換する
</h2>

次に、表をデータフレームに変換します。

```python theme={"system"}
# 前のコード例からの続き:
df = table.get_dataframe()
```

<h2 id="export-data">
  データのエクスポート
</h2>

これで、データフレームがサポートする任意の方法でエクスポートできます。

```python theme={"system"}
# 表のデータを .csv に変換
df.to_csv("example.csv", encoding="utf-8")
```

<h1 id="next-steps">
  次のステップ
</h1>

* `artifacts` に関する[リファレンスドキュメント](/ja/products/wandb/artifacts/construct-an-artifact)をご覧ください。
* [Tables ウォークスルー](/ja/products/wandb/tables/tables-walkthrough)ガイドをお試しください。
* [データフレーム](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html)のリファレンスドキュメントをご覧ください。


## Related topics

- [専用クラウドからデータをエクスポートする](/ja/products/wandb/platform/hosting/hosting-options/dedicated-cloud/export-data.md)
