# median

relationalai.semantics.std.aggregates

```python
median(*args: AggValue) -> Aggregate
```

Compute the median (50th percentile) of values, interpolating linearly
between the two closest ranks.

## Parameters

- `*args` (`AggValue`, default: `()`) - Values to compute the median over.

## Returns

- `Aggregate` - An `Aggregate` representing the computation of the median. Always returns `Float`.

## Examples

Compute the median order amount:

```python
select(aggregates.median(Order.amount))
```

Compute the median salary per department:

```python
select(Department, aggregates.median(Employee.salary).per(Department))
```

## Referenced By

1. [RelationalAI Documentation](/index.md)1) [What's new](/release-notes/index.md)1. [Python package and CLI release notes](/release-notes/python/index.md)1) [Python package and CLI 2.0.1](/release-notes/python/2.0.1/index.md)1. [Bug Fixes](/release-notes/python/2.0.1/index.md#bug-fixes)
