aggs_for_arrays
Various functions for computing statistics on arrays of numbers
Repository
pjungwir/aggs_for_arrays
https://github.com/pjungwir/aggs_for_arrays
Source
aggs_for_arrays-1.3.3.tar.gz
aggs_for_arrays-1.3.3.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
aggs_for_arrays | 1.3.3 | FUNC | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4750 | aggs_for_arrays | No | Yes | No | Yes | No | Yes | - |
| Related | intarray arraymath aggs_for_vecs floatvec |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.3.3 | 1817161514 | aggs_for_arrays | - |
| RPM | PIGSTY | 1.3.3 | 1817161514 | aggs_for_arrays_$v | - |
| DEB | PIGSTY | 1.3.3 | 1817161514 | postgresql-$v-aggs-for-arrays | - |
Build
You can build the RPM / DEB packages for aggs_for_arrays using pig build:
Install
You can install aggs_for_arrays directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
aggs_for_arrays: aggregate-like functions for single arrays (column-based)
Provides functions that compute statistics on a single array input. Supports SMALLINT, INTEGER, BIGINT, REAL, and DOUBLE PRECISION.
Functions
| Function | Description |
|---|---|
array_to_hist(values T[], start T, width T, count INT) | Compute histogram bucket counts |
array_to_hist_2d(x[], y[], ...) | 2-D histogram |
array_to_mean(values T[]) | Mean of array elements |
array_to_median(values T[]) | Median (unsorted input OK) |
sorted_array_to_median(values T[]) | Median (pre-sorted input) |
array_to_mode(values T[]) | Mode of array elements |
sorted_array_to_mode(values T[]) | Mode (pre-sorted input) |
array_to_percentile(values T[], pct FLOAT) | Percentile (0 to 1) |
sorted_array_to_percentile(values T[], pct FLOAT) | Percentile (pre-sorted input) |
array_to_percentiles(values T[], pcts FLOAT[]) | Multiple percentiles |
sorted_array_to_percentiles(values T[], pcts FLOAT[]) | Multiple percentiles (pre-sorted) |
array_to_max(values T[]) | Maximum element |
array_to_min(values T[]) | Minimum element |
array_to_min_max(values T[]) | {min, max} tuple |
array_to_skewness(values T[]) | Skewness |
array_to_kurtosis(values T[]) | Kurtosis |
Examples
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)