Python Check If Variable Is Numpy Faster