Answers for "numpy change dtype"

4

change type of array python

arr=arr.astype('uint8')
Posted by: Guest on March-20-2020
0

numpy data types change

# change the dtype to 'float64'
arr = arr.astype('float64')
  
# Print the array after changing
# the data type
print(arr)
  
# Also print the data type
print(arr.dtype)
Posted by: Guest on October-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language