# Data Preparation

Sequential data represents ordered records, such as in a timeseries. The entire table may contain records for a single entity (such as a user or patient). Alternatively, your table may also contain multiple, independent sequences belonging to different entities.

<figure><img src="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FzPsbsXbMULfrTaOTilK3%2Fsequential-data-data-preparation_May%208%202025.png?alt=media&#x26;token=478612f6-1474-4ae8-99fa-dfec4304b96d" alt=""><figcaption><p>This example shows sequential data related to vital signs. The table contains multiple sequences, each corresponding to a different patient. For each sequences, health measurements change over time.</p></figcaption></figure>

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

1. **Data**, a dictionary that maps every table name to a pandas DataFrame object containing the actual data
2. **Metadata**, a [Metadata](https://docs.sdv.dev/sdv/sequential-data/data-preparation/creating-metadata) object that describes your table. It includes the data types in each column, keys and other identifiers.

<details>

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

```python
{
    "METADATA_SPEC_VERSION": "SINGLE_TABLE_V1",
    "sequence_key": "Patient ID",
    "sequence_index": "Time",
    "columns": {
        "Patient ID": { "sdtype": "id", "regex_format": "ID_[0-9]{3}" },
        "Address": { "sdtype": "address", "pii": True },
        "Smoker": { "sdtype": "boolean" },
        "Time": { "sdtype": "datetime", "datetime_format": "%m/%d/%Y" },
        "Heart Rate": { "sdtype": "categorical" },
        "Systolic BP": { "sdtype": "numerical" }
    }
}
```

</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="data-preparation/loading-data"><strong>Loading Data</strong></a></td><td>Get started with a demo dataset or load your own data.</td><td><a href="data-preparation/loading-data">loading-data</a></td></tr><tr><td><a href="data-preparation/creating-metadata"><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="data-preparation/creating-metadata">creating-metadata</a></td></tr></tbody></table>
