numpy convert string array to int array code example Example: python ndarray string array into int y = y.astype(np.uint8)