I noticed when converting from numpy array to list that python adds extra decimals. For example here I have some bytes that I convert to a numpy array with float32 elements:
import numpy as np
b = bytes([174, 153, 92, 59])
a = np.frombuffer(b, dtype=np.float32)
print(a[0])
print(a.tolist()[0])
Output:
0.0033660936
0.0033660936169326305
On the conversion with a.tolist()
it adds extra decimals.
What is happening here? Do I loose some precision, or where is python finding these extra decimals?