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