numpy array change data type to string code example
Example 1: change type of array python
arr=arr.astype('uint8')
Example 2: np as type
>>> x.astype(int)
array([1, 2, 2])
arr=arr.astype('uint8')
>>> x.astype(int)
array([1, 2, 2])