Array Statistics
array_statisticsCalculate statistical measures (mean, median, std, min, max, sum) on arrays. Supports column-wise, row-wise, or overall computations using Polars.
Instructions
Calculate statistical measures on arrays using Polars.
Supports computation across entire array, rows, or columns.
Examples:
COLUMN-WISE MEANS: data=[[1,2,3],[4,5,6]], operations=["mean"], axis=0 Result: [2.5, 3.5, 4.5] (average of each column)
ROW-WISE MEANS: data=[[1,2,3],[4,5,6]], operations=["mean"], axis=1 Result: [2.0, 5.0] (average of each row)
OVERALL STATISTICS: data=[[1,2,3],[4,5,6]], operations=["mean","std"], axis=None Result: {mean: 3.5, std: 1.71}
MULTIPLE STATISTICS: data=[[1,2,3],[4,5,6]], operations=["min","max","mean"], axis=0 Result: {min: [1,2,3], max: [4,5,6], mean: [2.5,3.5,4.5]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional annotation to label this calculation (e.g., 'Bond A PV', 'Q2 revenue'). Appears in results for easy identification. | |
| output_mode | No | Output format: full (default), compact, minimal, value, or final. See batch_execute tool for details. | full |
| data | Yes | 2D array (e.g., [[1,2,3],[4,5,6]]) | |
| operations | Yes | Statistics to compute (e.g., ['mean','std']) | |
| axis | No | Axis: 0=column-wise, 1=row-wise, None=overall |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |