> ## Documentation Index
> Fetch the complete documentation index at: https://docs.athina.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Execution

> Execute a python function on every row

The `CodeExecution` dynamic column will execute a python function on every row of your dataset.

This can be useful to transform your data, which is often useful as an intermediary step for running evaluations or prompts.

**Output type**: `any`

#### Inputs

* **Code**: The code to be executed.

The python function must be named `main`.

The function will receive the row as a dictionary and should return the transformed row.

For example:

```python
# Function name should be main only. You can access any column of the row using the kwargs.
def main(**kwargs):
    return kwargs['query'].replace(' ', '_')
```

<Tip>You can access data from any column using `kwargs.get('COLUMN_NAME')`</Tip>

<div style={{ position: "relative", paddingBottom: "56.25%", height: 0 }}>
  <iframe
    src="https://jumpshare.com/embed/zLqVVkgl08gH2UBRhW1X"
    frameborder="0"
    webkitallowfullscreen
    mozallowfullscreen
    allowfullscreen
    style={{
  position: "absolute",
  top: 0,
  left: 0,
  width: "100%",
  height: "100%",
}}
  />
</div>

### Limitations

You cannot import any external libraries in the code execution dynamic column.

The code execution dynamic column only supports the standard Python libraries.
