<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/as_dataframe.py#L144-L217) |

Convert the dataset into a pandas dataframe.

    tfds.as_dataframe(
        ds: tf.data.Dataset, ds_info: Optional[dataset_info.DatasetInfo] = None
    ) -> pd.DataFrame

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Custom training: walkthrough](https://www.tensorflow.org/tutorials/customization/custom_training_walkthrough) - [TensorFlow Datasets](https://www.tensorflow.org/datasets/overview) - [Linear Mixed-Effect Regression in {TF Probability, R, Stan}](https://www.tensorflow.org/probability/examples/HLM_TFP_R_Stan) - [Fitting Generalized Linear Mixed-effects Models Using Variational Inference](https://www.tensorflow.org/probability/examples/Linear_Mixed_Effects_Model_Variational_Inference) - [Multilevel Modeling Primer in TensorFlow Probability](https://www.tensorflow.org/probability/examples/Multilevel_Modeling_Primer) |

> [!WARNING]
> **Warning:** The dataframe will be loaded entirely in memory, you may want to call [`tfds.as_dataframe`](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe) on a subset of the data instead:

    df = tfds.as_dataframe(ds.take(10), ds_info)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `ds` | [`tf.data.Dataset`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset). The tf.data.Dataset object to convert to panda dataframe. Examples should not be batched. The full dataset will be loaded. |
| `ds_info` | Dataset info object. If given, helps improving the formatting. Available either through `tfds.load('mnist', with_info=True)` or `tfds.builder('mnist').info` |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `dataframe` | The `pandas.DataFrame` object |

<br />