I'm stuck. I currently have the following example file structure:
X, Y, Z
0.000234E+04, 0.000244E+03, 0.000234E+04
0.000244E+03, 0.000234E+04, 0.000238E+05
0.000238E+05, 0.000244E+03, 0.000234E+04
I would like for the Scientific Notation to be converted to float or integer values:
X, Y, Z
2.34, 0.244, 2.34
0.244, 2.34, 23.8
23.8, 0.244, 2.34
I have tried the following code:
p=open('file_with_data.txt')
r=p.readline()
r=p.readline() ##to skip over first row##
y=r.split()
for i in y: float(i)
The code worked converting the sci-notated numbers but it did not return a list. Instead it returned each number individually:
2.34
0.244
2.34
I just ran it on one line. I understand I will need to add a loop mechanism but I wanted to get the first line outputed to a list first as the real dataset has nearly a 160,000 lines...
Any help would be much appreciated!!