# OneHotEncoder

**Compatibility:** `categorical` data

The `OneHotEncoder` transforms data that represents unordered, categorical values into multiple columns -- one for each category. These new columns have `0` and `1` values. A `1` indicates the correct, original category.

![In this example, VISA is encoded in the credit\_card.value0 column, AMEX is encoded in the credit\_card.value1 column, etc.](/files/0iCl02By4T3qOJ9YjyMg)

```python
from rdt.transformers.categorical import OneHotEncoder
ohe = OneHotEncoder()
```

{% hint style="warning" %}
The `OneHotEncoder` creates a new column for each category in your input data. If you have a large number of categories, it will create a large number of new columns. Each extra column uses more memory and increases the RDT processing time. If this is a concern, consider using other transformers like the [LabelEncoder](/rdt/transformers-glossary/categorical/labelencoder.md) instead.
{% endhint %}

## Parameters

No parameters are available for this transformer.

## FAQs

<details>

<summary>What happens to missing values?</summary>

This transformer treats missing values as if they are a new category of data.

</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/rdt/transformers-glossary/categorical/onehotencoder.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.
