the proper way is to use y.ndim