# Data Preparation

Single table data contains rows and columns of information. Each row typically represents a new entity such as a user, transaction, or session.

<figure><img src="/files/gbKU9GXWo5FzmzeF0TaO" alt=""><figcaption><p>This example of a single table includes a new row for each guest of a hotel.</p></figcaption></figure>

Before you begin creating synthetic data, it's important to have your data ready in the right format:

1. **Data**, loaded into Python as a [pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) object, and
2. **Metadata**, a [Metadata](/sdv/concepts/metadata.md) object that describes your table. It includes the data types in each column, primary keys and other identifiers.

<details>

<summary>Click to see the table's metadata</summary>

```python
{
    "METADATA_SPEC_VERSION": "V1",
    "tables": {
        "hotel_guests": {
            "primary_key": "guest_email",
            "alternate_keys": [ "credit_card_number" ],
            "columns": {
                "guest_email": { "sdtype": "email", "pii": true },
                "has_rewards": { "sdtype": "boolean" },
                "room_type": { "sdtype": "categorical" },
                "amenities_fee": { "sdtype": "numerical" },
                "checkin_date": { "sdtype": "datetime", "datetime_format": "%d %b %Y" },
                "checkout_date": { "sdtype": "datetime", "datetime_format": "%d %b %Y" },
                "room_rate": { "sdtype": "numerical" },
                "billing_address": { "sdtype": "address", "pii": true },
                "credit_card_number": { "sdtype": "credit_card_number", "pii": true }
            }
        }
    }
}
```

</details>

### Learn More

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/pages/6YT3gdYDerHjOl7bImVk"><strong>Loading Data</strong></a></td><td>Get started with a demo dataset or load your own data.</td><td><a href="/pages/6YT3gdYDerHjOl7bImVk">/pages/6YT3gdYDerHjOl7bImVk</a></td></tr><tr><td><a href="/pages/IsYAXuS2OzUaem9MKQn3"><strong>Creating Metadata</strong></a></td><td>Create an object to describe the different columns in your data. Save it for future use.</td><td><a href="/pages/IsYAXuS2OzUaem9MKQn3">/pages/IsYAXuS2OzUaem9MKQn3</a></td></tr></tbody></table>

## FAQs

<details>

<summary>Can there be an order between the rows?</summary>

For a true, single table data usage, the rows should be independent -- i.e. there should be no ordering or dependencies between the rows of your table.

If you do have a specific order, your data is likely sequential. You can still write a single table metadata but some additional details. See the [Sequential Data](/sdv/sequential-data/data-preparation.md) section for more information.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sdv.dev/sdv/single-table-data/data-preparation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
