Q:

Write a NumPy program to convert numpy dtypes to native python types

0

Write a NumPy program to convert numpy dtypes to native python types.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
print("numpy.float32 to python float")
x = np.float32(0)
print(type(x))
pyval = x.item()
print(type(pyval))
Sample Output:
numpy.float32 to python float
<class 'numpy.float32'>
<class 'float'>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now