Replacing csv sequence decimal and seperator signs throuout code and examples

decimal sign now point, seperator now comma
This commit is contained in:
2023-02-11 21:30:36 +01:00
parent 25513cc7c5
commit c5a9c2649b
7 changed files with 70 additions and 70 deletions
+23 -23
View File
@@ -1,23 +1,23 @@
Time (s);xField (T);yField (T);zField (T)
0,5;0,000015;0,000025;0,00002
1;0,0000155;0,0000245;0,0000205
1,5;0,000016;0,000024;0,000021
2;0,0000165;0,0000235;0,0000215
2,5;0,000017;0,000023;0,000022
3;0,0000175;0,0000225;0,0000225
3,5;0,000018;0,000022;0,000023
4;0,0000185;0,0000215;0,0000235
4,5;0,000019;0,000021;0,000024
5;0,0000195;0,0000205;0,0000245
5,5;0,00002;0,00002;0,000025
6;0,0000205;0,0000195;0,0000245
6,5;0,000021;0,000019;0,000024
7;0,0000215;0,0000185;0,0000235
7,5;0,000022;0,000018;0,000023
8;0,0000225;0,0000175;0,0000225
8,5;0,000023;0,000017;0,000022
9;0,0000235;0,0000165;0,0000215
9,5;0,000024;0,000016;0,000021
10;0,0000245;0,0000155;0,0000205
10,5;0,000025;0,000015;0,00002
11;0,000025;0,000015;0,00002
"Time [s]]","xField [T]","yField [T]","zField [T]"
0.5,0.000015,0.000025,0.00002
1,0.0000155,0.0000245,0.0000205
1.5,0.000016,0.000024,0.000021
2,0.0000165,0.0000235,0.0000215
2.5,0.000017,0.000023,0.000022
3,0.0000175,0.0000225,0.0000225
3.5,0.000018,0.000022,0.000023
4,0.0000185,0.0000215,0.0000235
4.5,0.000019,0.000021,0.000024
5,0.0000195,0.0000205,0.0000245
5.5,0.00002,0.00002,0.000025
6,0.0000205,0.0000195,0.0000245
6.5,0.000021,0.000019,0.000024
7,0.0000215,0.0000185,0.0000235
7.5,0.000022,0.000018,0.000023
8,0.0000225,0.0000175,0.0000225
8.5,0.000023,0.000017,0.000022
9,0.0000235,0.0000165,0.0000215
9.5,0.000024,0.000016,0.000021
10,0.0000245,0.0000155,0.0000205
10.5,0.000025,0.000015,0.00002
11,0.000025,0.000015,0.00002
1 Time (s) Time [s]] xField (T) xField [T] yField (T) yField [T] zField (T) zField [T]
2 0,5 0.5 0,000015 0.000015 0,000025 0.000025 0,00002 0.00002
3 1 1 0,0000155 0.0000155 0,0000245 0.0000245 0,0000205 0.0000205
4 1,5 1.5 0,000016 0.000016 0,000024 0.000024 0,000021 0.000021
5 2 2 0,0000165 0.0000165 0,0000235 0.0000235 0,0000215 0.0000215
6 2,5 2.5 0,000017 0.000017 0,000023 0.000023 0,000022 0.000022
7 3 3 0,0000175 0.0000175 0,0000225 0.0000225 0,0000225 0.0000225
8 3,5 3.5 0,000018 0.000018 0,000022 0.000022 0,000023 0.000023
9 4 4 0,0000185 0.0000185 0,0000215 0.0000215 0,0000235 0.0000235
10 4,5 4.5 0,000019 0.000019 0,000021 0.000021 0,000024 0.000024
11 5 5 0,0000195 0.0000195 0,0000205 0.0000205 0,0000245 0.0000245
12 5,5 5.5 0,00002 0.00002 0,00002 0.00002 0,000025 0.000025
13 6 6 0,0000205 0.0000205 0,0000195 0.0000195 0,0000245 0.0000245
14 6,5 6.5 0,000021 0.000021 0,000019 0.000019 0,000024 0.000024
15 7 7 0,0000215 0.0000215 0,0000185 0.0000185 0,0000235 0.0000235
16 7,5 7.5 0,000022 0.000022 0,000018 0.000018 0,000023 0.000023
17 8 8 0,0000225 0.0000225 0,0000175 0.0000175 0,0000225 0.0000225
18 8,5 8.5 0,000023 0.000023 0,000017 0.000017 0,000022 0.000022
19 9 9 0,0000235 0.0000235 0,0000165 0.0000165 0,0000215 0.0000215
20 9,5 9.5 0,000024 0.000024 0,000016 0.000016 0,000021 0.000021
21 10 10 0,0000245 0.0000245 0,0000155 0.0000155 0,0000205 0.0000205
22 10,5 10.5 0,000025 0.000025 0,000015 0.000015 0,00002 0.00002
23 11 11 0,000025 0.000025 0,000015 0.000015 0,00002 0.00002
+15 -15
View File
@@ -1,15 +1,15 @@
Time (s);xField (T);yField (T);zField (T)
0;0,0000145;0,0000255;0,0000195
0,1;-0,000015;0,000025;0,00002
0,2;-0,0000155;-0,0000245;0,0000205
0,3;-0,000016;-0,000024;-0,000021
0,4;0,0000165;-0,0000235;-0,0000215
0,5;0,000017;0,000023;-0,000022
0,6;0,0000175;0,0000225;0,0000225
0,7;-0,000018;-0,000022;0,000023
0,8;0,0000185;-0,0000215;-0,0000235
0,9;-0,000019;0,000021;-0,000024
1;-0,0000195;-0,0000205;-0,0000245
1,1;0,00002;0,00002;0,000025
1,2;-0,0000205;-0,0000195;-0,0000245
1,3;0,000021;0,000019;0,000024
"Time [s]]","xField [T]","yField [T]","zField [T]"
0,0.0000145,0.0000255,0.0000195
0.1,-0.000015,0.000025,0.00002
0.2,-0.0000155,-0.0000245,0.0000205
0.3,-0.000016,-0.000024,-0.000021
0.4,0.0000165,-0.0000235,-0.0000215
0.5,0.000017,0.000023,-0.000022
0.6,0.0000175,0.0000225,0.0000225
0.7,-0.000018,-0.000022,0.000023
0.8,0.0000185,-0.0000215,-0.0000235
0.9,-0.000019,0.000021,-0.000024
1,-0.0000195,-0.0000205,-0.0000245
1.1,0.00002,0.00002,0.000025
1.2,-0.0000205,-0.0000195,-0.0000245
1.3,0.000021,0.000019,0.000024
1 Time (s) Time [s]] xField (T) xField [T] yField (T) yField [T] zField (T) zField [T]
2 0 0 0,0000145 0.0000145 0,0000255 0.0000255 0,0000195 0.0000195
3 0,1 0.1 -0,000015 -0.000015 0,000025 0.000025 0,00002 0.00002
4 0,2 0.2 -0,0000155 -0.0000155 -0,0000245 -0.0000245 0,0000205 0.0000205
5 0,3 0.3 -0,000016 -0.000016 -0,000024 -0.000024 -0,000021 -0.000021
6 0,4 0.4 0,0000165 0.0000165 -0,0000235 -0.0000235 -0,0000215 -0.0000215
7 0,5 0.5 0,000017 0.000017 0,000023 0.000023 -0,000022 -0.000022
8 0,6 0.6 0,0000175 0.0000175 0,0000225 0.0000225 0,0000225 0.0000225
9 0,7 0.7 -0,000018 -0.000018 -0,000022 -0.000022 0,000023 0.000023
10 0,8 0.8 0,0000185 0.0000185 -0,0000215 -0.0000215 -0,0000235 -0.0000235
11 0,9 0.9 -0,000019 -0.000019 0,000021 0.000021 -0,000024 -0.000024
12 1 1 -0,0000195 -0.0000195 -0,0000205 -0.0000205 -0,0000245 -0.0000245
13 1,1 1.1 0,00002 0.00002 0,00002 0.00002 0,000025 0.000025
14 1,2 1.2 -0,0000205 -0.0000205 -0,0000195 -0.0000195 -0,0000245 -0.0000245
15 1,3 1.3 0,000021 0.000021 0,000019 0.000019 0,000024 0.000024
+15 -15
View File
@@ -1,15 +1,15 @@
Time (s);xField (T);yField (T);zField (T)
0;0,0000145;0,0000255;0,0000195
1;-0,000015;0,000025;0,00002
2;-0,0000155;-0,0000245;0,0000205
3;-0,000016;-0,000024;-0,000021
4;0,0000165;-0,0000235;-0,0000215
5;0,000017;0,000023;-0,000022
6;0,0000175;0,0000225;0,0000225
7;-0,000018;-0,000022;0,000023
8;0,0000185;-0,0000215;-0,0000235
9;-0,000019;0,000021;-0,000024
10;-0,0000195;-0,0000205;-0,0000245
11;0,00002;0,00002;0,000025
12;-0,0000205;-0,0000195;-0,0000245
13;0,000021;0,000019;0,000024
"Time [s]]","xField [T]","yField [T]","zField [T]"
0,0.0000145,0.0000255,0.0000195
1,-0.000015,0.000025,0.00002
2,-0.0000155,-0.0000245,0.0000205
3,-0.000016,-0.000024,-0.000021
4,0.0000165,-0.0000235,-0.0000215
5,0.000017,0.000023,-0.000022
6,0.0000175,0.0000225,0.0000225
7,-0.000018,-0.000022,0.000023
8,0.0000185,-0.0000215,-0.0000235
9,-0.000019,0.000021,-0.000024
10,-0.0000195,-0.0000205,-0.0000245
11,0.00002,0.00002,0.000025
12,-0.0000205,-0.0000195,-0.0000245
13,0.000021,0.000019,0.000024
1 Time (s) Time [s]] xField (T) xField [T] yField (T) yField [T] zField (T) zField [T]
2 0 0,0000145 0.0000145 0,0000255 0.0000255 0,0000195 0.0000195
3 1 -0,000015 -0.000015 0,000025 0.000025 0,00002 0.00002
4 2 -0,0000155 -0.0000155 -0,0000245 -0.0000245 0,0000205 0.0000205
5 3 -0,000016 -0.000016 -0,000024 -0.000024 -0,000021 -0.000021
6 4 0,0000165 0.0000165 -0,0000235 -0.0000235 -0,0000215 -0.0000215
7 5 0,000017 0.000017 0,000023 0.000023 -0,000022 -0.000022
8 6 0,0000175 0.0000175 0,0000225 0.0000225 0,0000225 0.0000225
9 7 -0,000018 -0.000018 -0,000022 -0.000022 0,000023 0.000023
10 8 0,0000185 0.0000185 -0,0000215 -0.0000215 -0,0000235 -0.0000235
11 9 -0,000019 -0.000019 0,000021 0.000021 -0,000024 -0.000024
12 10 -0,0000195 -0.0000195 -0,0000205 -0.0000205 -0,0000245 -0.0000245
13 11 0,00002 0.00002 0,00002 0.00002 0,000025 0.000025
14 12 -0,0000205 -0.0000205 -0,0000195 -0.0000195 -0,0000245 -0.0000245
15 13 0,000021 0.000021 0,000019 0.000019 0,000024 0.000024
+12 -12
View File
@@ -1,12 +1,12 @@
Time (s);xField (T);yField (T);zField (T);
0;0,00015;-0,00015;0,00002;150
1;0,00017;-0,00017;0,00002;170
2;0,00018;-0,00018;0,00002;180
3;0,00019;-0,00019;0,00002;190
4;0,0002;-0,0002;0,00002;200
5;0,00021;0,00021;0,00002;210
6;0,00022;-0,00022;0,00002;220
7;0,0002;-0,0002;0,00002;200
8;0,00018;-0,00018;0,00002;180
9;0,00005;-0,00005;0,00002;50
10;-0,00004;0,00004;0,00002;-40
"Time [s]]","xField [T]","yField [T]","zField [T]"
0,0.00015,-0.00015,0.00002,150
1,0.00017,-0.00017,0.00002,170
2,0.00018,-0.00018,0.00002,180
3,0.00019,-0.00019,0.00002,190
4,0.0002,-0.0002,0.00002,200
5,0.00021,0.00021,0.00002,210
6,0.00022,-0.00022,0.00002,220
7,0.0002,-0.0002,0.00002,200
8,0.00018,-0.00018,0.00002,180
9,0.00005,-0.00005,0.00002,50
10,-0.00004,0.00004,0.00002,-40
1 Time (s) Time [s]] xField (T) xField [T] yField (T) yField [T] zField (T) zField [T]
2 0 0,00015 0.00015 -0,00015 -0.00015 0,00002 0.00002 150
3 1 0,00017 0.00017 -0,00017 -0.00017 0,00002 0.00002 170
4 2 0,00018 0.00018 -0,00018 -0.00018 0,00002 0.00002 180
5 3 0,00019 0.00019 -0,00019 -0.00019 0,00002 0.00002 190
6 4 0,0002 0.0002 -0,0002 -0.0002 0,00002 0.00002 200
7 5 0,00021 0.00021 0,00021 0.00021 0,00002 0.00002 210
8 6 0,00022 0.00022 -0,00022 -0.00022 0,00002 0.00002 220
9 7 0,0002 0.0002 -0,0002 -0.0002 0,00002 0.00002 200
10 8 0,00018 0.00018 -0,00018 -0.00018 0,00002 0.00002 180
11 9 0,00005 0.00005 -0,00005 -0.00005 0,00002 0.00002 50
12 10 -0,00004 -0.00004 0,00004 0.00004 0,00002 0.00002 -40
+1 -1
View File
@@ -1,4 +1,4 @@
"t [s]","x [T]","y [T]","z [T]"
"Time [s]]","xField [T]","yField [T]","zField [T]"
0.0,0.0,-1.7452406437283511e-06,9.998476951563913e-05
1.0,0.0,-3.489949670250097e-06,9.993908270190956e-05
2.0,0.0,-5.233595624294383e-06,9.986295347545739e-05
1 t [s] Time [s]] x [T] xField [T] y [T] yField [T] z [T] zField [T]
2 0.0 0.0 -1.7452406437283511e-06 9.998476951563913e-05
3 1.0 0.0 -3.489949670250097e-06 9.993908270190956e-05
4 2.0 0.0 -5.233595624294383e-06 9.986295347545739e-05
+3 -3
View File
@@ -112,13 +112,13 @@ class ExecCSVThread(Thread):
def read_csv_to_array(filepath): # convert a given csv file to a numpy array
# csv format: time (s); xField (T); yField (T); zField (T) (german excel)
# csv format: time [s], xField [T], yField [T], zField [T] (german excel)
# decimal or period commas. Do not use these characters as a thousands seperator!
with open(filepath, 'r') as csv_file:
# Normalize seperators
csv_string = csv_file.read().replace(',', '.')
csv_string = csv_file.read()
# read csv file without column headers
file = pandas.read_csv(StringIO(csv_string), sep=';', decimal='.', header=0)
file = pandas.read_csv(StringIO(csv_string), sep=',', decimal='.', header=0)
array = file.to_numpy() # convert csv to array
return array
+1 -1
View File
@@ -671,7 +671,7 @@ class ExecuteCSVMode(Frame):
# Assemble data to export
rot_sequence = dict(enumerate(t))
for i in range(len(t)):
rot_sequence[i] = {'Time (s)': t[i], 'xField (T)': x[i], 'yField (T)': y[i], 'zField (T)': z[i]}
rot_sequence[i] = {'Time [s]]': t[i], 'xField [T]': x[i], 'yField [T]': y[i], 'zField [T]': z[i]}
# Save dictionary to disk
save_dict_list_to_csv2('test_sequence_rotation.csv', rot_sequence, query_path=True)
ui_print("Saved test sequence to disc.")