Before this question gets flagged and closed, I saw this question already, yet it does not quite answer my problem.
I would like to calculate the element-wise average over the arrays in the field per row, and keep the dimensionsionality
create table if not exists my_arrays (array_field float[]);
insert into my_arrays values ('{1,2,3}');
insert into my_arrays values ('{3,2,1}');
insert into my_arrays values ('{3,2,1}');
insert into my_arrays values ('{1,2,3}');
select avg(array_field) as x from my_arrays;
Which should output:
x
---------
{2, 2, 2}
Is this possible?