That's a neat trick! I've never seen that 'return_inverse' kwarg! Its one of the few things I missed when I made the  switch from matlab to numpy.