This condition may not suffice, e.g. for 0d arrays. Use `np.isscalar`.