I have a numpy file and I want to read in 3 separate columns of data from a single file. I created the data through three separate arrays where data1 = floating point, and data2 = data3 = string. The data were saved such that:
np.save(infofile, [data1, data2, data3])
I am able to read the file and load the data with the following command:
data1, data2, data3 = np.load(infofile)
where data1 will be a floating point value, and data2 and data3 are strings. Each will be ~ 1,000 rows long. When I try to look at the data, I get:
print(data1[0])
b'0.0'
print(data2[0])
b'10000'
print(data3[0])
b'20190831.230000'
I know the data is in binary, so how do I remove the preceding 'b' from all of the data so it would look like:
print(data1[0])
0.0
print(data2[0])
'10000'
print(data3[0])
'20190831.230000'
b''prefix indicates a Python 3bytesobject.