I cant load text using numpy.loadtxt for the list of string inside 'file.dat':
['3317121918', '69', '1345', '15']
['3317122000', '72', '1337', '20']
['3317122006', '75', '1330', '20']
['3317122012', '78', '1321', '20']
['3317122018', '83', '1310', '25']
['3317122100', '86', '1295', '35']
['3317122106', '85', '1284', '35']
['3317122112', '84', '1276', '40']
['3317122118', '79', '1267', '50']
Code used now.
import numpy as np
data=np.loadtxt('file.dat')
x=data[:,1]
y=data[:,2]
z=data[:,3]
I am trying to assign those values in proper column from this command but the iteration says "could not convert string to float:". How to convert this list of string to float?.
Expected output for x, y and z are supposed to be:
x=[69,72,75,78,83,85,85,84,70]
y=[1345,1337,1330,1321,1310,1295,1284,1276,1267]
z=[15,20,20,20,25,35,35,40,50]