smarter numpy comparison