Make sure impurity only accepts numpy arrays