Median / List Layer
Calculate the median value of each variable-length numeric list. Similar to numpy.median() or R's median(). For even-length lists, returns average of two middle values. Returns null for empty lists.
Example transformation:
lists | median |
---|---|
[1, 2, 3, 4] | 2.5 |
[1, 5, 3] | 3 |
[7] | 7 |
[4, null, 2, null, 6] | 4 |
[] | null |
[null, null] | null |
Common applications:
- Finding typical values resistant to outliers
- Analyzing income distributions
- Processing sensor readings with noise
- Evaluating performance metrics
- Analyzing price distributions
- Computing robust averages in presence of extremes
Note: Only works with numeric lists. Null values are ignored unless list is empty or contains only nulls, then returns null. Lists can have any length. Particularly useful for finding central tendencies in data with outliers.
Table
0
0
Table
Select
columnThe variable-length numeric list column to analyze. Examples:
- Response times: [0.1, 0.2, 0.15, 5.0]
- Price points: [9.99, 10.50, 12.99, 8.99]
- Test scores: [85, 92, 78, 88, 90]
- Measurements: [1.1, null, 1.2, 1.15] Lists can have different lengths. Only numeric types supported.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.