# Unpivots

Unpivot unpivots a DataFrame from wide format to long format

## Dataset

{{code_block('user-guide/transformations/unpivot','df',['DataFrame'])}}

```python exec="on" result="text" session="user-guide/transformations/unpivot"
--8<-- "python/user-guide/transformations/unpivot.py:df"
```

## Eager + lazy

`Eager` and `lazy` have the same API.

{{code_block('user-guide/transformations/unpivot','unpivot',['unpivot'])}}

```python exec="on" result="text" session="user-guide/transformations/unpivot"
--8<-- "python/user-guide/transformations/unpivot.py:unpivot"
```
