21 lines
829 B
Python
21 lines
829 B
Python
import numpy as np
|
|
import csv
|
|
|
|
path = "D:\\Glaskryostat\\Daten\\2024-09-25 LG Python test\\AMR_Kalibration\\2024-09-25_14-48-23_short.txt"
|
|
delim = "\t"
|
|
rows = []
|
|
with open(path, 'r') as file:
|
|
csvreader = csv.reader(file,delimiter = delim)
|
|
for row in csvreader:
|
|
rows.append(row)
|
|
|
|
#recreate arrays
|
|
coeffs = []
|
|
for r in rows[0][0:44]: #last entry is '' at index 45
|
|
r_short = r[2:-1] #get rid of "[ "at the beginning, and "]" at the end
|
|
r_split = r_short.split(' ') #split at every space
|
|
coeff_list = [x for x in r_split if x != ''] #get rid of empty entries that can occur if a double space was written in the text file
|
|
coeff_list = [float(x) for x in coeff_list] #convert str to float
|
|
coeff_array = np.array(coeff_list)
|
|
coeffs.append(coeff_array)
|