Postgresql Get Unique Values From Numpy Matrix