change dtype of numpy array float32 code example Example: change type of array python arr=arr.astype('uint8')