Median

A Callable for returning the median of a column.

Definition

class controller.callable.transformer.Median(self, column: ColumnReference, output_name: str, output_list: list[str])
Callable name:

median

Callable type:

Transformer

Parameters:
  • column (ColumnReference) – A column reference where the values in the column are used to calculate the median.

  • output_name (str) – The name of the new column containing the Callable output.

  • output_list (list[str]) – A list of columns to return.

Parameters

column

A column reference where the values in the column are used to calculate the median.

Type:

ColumnReference

Required:

True

Choices:

All columns in the target DataFrame

output_name

The name of the new column containing the Callable output.

Type:

str

Required:

True

output_list

A list of columns to return.

Type:

list[str]

Required:

True

Choices:

All columns in the target DataFrame, plus the new column created by this Callable

Output

A DataFrame is returned where it contains all columns specified in the output_list, potentially including a new column with the name <callable_id>.<output_name>.

Example configuration

{
    "name": "foo",
    "callable": "median",
    "params": {
        "column": "$get_submissions.submission.score",
        "output_name": "median_score",
        "output_list": [
            "get_submissions.submission.id",
            "get_submissions.submission.score",
            "foo.median_score"
        ]
    }
}