Postgresql Window Function Count Python Array Example