# Conditional Sampling

Do you have exact context that you'd like to include in the synthetic sequences? Using **conditional sampling** to provide this information.

## Condition on Known Context

Do you already know all the context for each sequence? The SDV can factor in the context columns and generate sequences based on them.

### sample\_sequential\_columns

Use this function to sample the sequences based on known context columns that do not change.

**Parameters**

* (required) `context_columns`: A [pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) that contains the sequence key and all the context columns of your data that do not vary with respect to time. Each row corresponds to a sequence that you want to synthesize.
* `sequence_length`: An integer >0 describing the length of each sequence. If you provide `None`, the synthesizer will determine the lengths algorithmically, and the length may be different for each sequence. Defaults to `None`.

**Returns** A [pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) object with synthetic data. The synthetic data is based on the referenced, context columns.


---

# 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/sequential-data/sampling/conditional-sampling.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.
