Answer the question
In order to leave comments, you need to log in
Translation of table data (x, y) from dat file to list?
I'm having a problem reading a datian file. I am reading data and writing to numpy array:
m = 'model_spectrum_090412.dat'
f = open(m, 'r')
pmod = f.read()
model = np.array( for k in f)
f.close()
g = '090412.dat'
f1 = open(g, 'r')
pdat = f1.read()
data = np.array( for t in g)
f1.close()
Answer the question
In order to leave comments, you need to log in
f = open("data.dat", "r", encoding="utf-8")
n = []
for i in f:
n.append([i.split()[0], i.split() [1]])
print(n)
f.close()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question