Postgresql Row To Array Python Initialize Matrix