I'm trying to insert values in a .bin file to an array. However, at the first line I get the error message:
ValueError: could not convert string to float: b'\x00\x00\x00\x00\xdd\xb9\xa8\tLv\x1e\xc0\x9b\xd0C\xb0\n'
Here is the code:
import os
import numpy as np
def readdata():
filename1 = "data.bin"
f1 = open (filename1,'rb')
f1stat = os.stat(filename1)
count = f1stat.st_size
data = np.zeros((5,count), dtype= np.float)
for i in range(5):
for j in range(count):
data[i][j] = f1.readline()