Python: GroupReduce/Filter/Cross