So, I have been browsing stackoverflow for quite some time now, but I can\'t seem to find the solution for my problem
Consider this
import numpy as n
This is a simple one-liner using the numpy_indexed package (disclaimer: I am its author):
import numpy_indexed as npi
unique, mean = npi.group_by(coo).mean(values)
Should be comparable to the currently accepted answer in performance, as it does similar things under the hood; but all in a well tested package with a nice interface.