I need to import a array value of a txt file but when i print to see my values i get this error: "could not convert string to float: vector(0.1013, 0.2395, 1.1926), vector(0.1276, 0.2361, 1.1760), vector(0.13952644965926353, 0.23617897201269641, 1.1760001652770353), vector(0.16723382973344353, 0.23617897201269641, 1.176000165277035" showing only a few values of the array. Any idea as to what I am doing wrong and what would be the correct way to do it ?
def load_files(self):
dlg = wx.FileDialog(None,message="Choose File",wildcard= 'Points (*.txt; *.csv)|*.txt;*.csv', defaultFile="",style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST|wx.FD_CHANGE_DIR)
if dlg.ShowModal() == wx.ID_CANCEL:
print ('buh cancelaste')
else:
filename=dlg.GetFilename()
f = open(filename)
data = f.read()
data = np.array(data).astype(float)
print(data)
files = wx.Button(pan, label='Load Coordinates', pos=(x1+158,570), size = (150,40))
files.Bind(wx.EVT_BUTTON, load_files)
txt file.
vector(0.1013, 0.2395, 1.1926), vector(0.1276, 0.2361, 1.1760), vector(0.13952644965926353, 0.23617897201269641, 1.1760001652770353), vector(0.16723382973344353, 0.23617897201269641, 1.1760001652770353), vector(0.18306661834726065, 0.23617897201269641, 1.1760001652770353), vector(0.21077399842144068, 0.23219954535704859, 1.1760001652770353), vector(0.22264858988180353, 0.22822011870140083, 1.1760001652770353), vector(0.23452318134216635, 0.22822011870140083, 1.1760001652770353)
vector(-3.22925576, 0.78085742, 8.2709313 ), vector(0.12270437, 0.29943441, 1.65709467), vector(0.1278586, 0.09019178, 1.24548948), vector(0.25600214, -0.04258577, 0.6109198)
vector(0.12795994, 0.30532043, 1.6896684 ), vector( 0.13624277, 0.09229906, 1.24548948), vector(0.29656594, -0.08827312, 0.69378916), vector (0.19870717, -0.09120946, 1.19266453)