correct way to get numpy array dimensions