convert class numpy ndarray to type numpyndaaray code example Example: np as type >>> x.astype(int) array([1, 2, 2])