Remove unused import
Use numpy's advanced indexing

Thanks @ElBrogrammer!