I\'m working with 3D pointcloud of Lidar. The points are given by numpy array that looks like this:
points = np.array([[61651921, 416326074, 39805], [6160525
You might just iterate and add the index of each element to the corresponding list.
from collections import defaultdict
res = defaultdict(list)
for idx, elem in enumerate(cubes):
#res[tuple(elem)].append(idx)
res[elem.tobytes()].append(idx)
Runtime can be further improved by using tobytes() instead of converting the key to a tuple.