Add astype to ndarray.