This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_data_to_csv(data): | |
""" | |
Write the previously generate data to a csv file. | |
""" | |
time_string = datetime.datetime.now().strftime('%Y%h%d_%H%M') | |
csv_name = f'{time_string}_for_spss-import.sim.csv' | |
with open(csv_name, 'w', encoding='utf-8', newline='') as csvfile: | |
# CSV writer instance | |
writer = csv.writer(csvfile, quoting=csv.QUOTE_NONNUMERIC, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"ID";"Einrichtung";"T1_De_NEU";"T1_Pa_NEU";"T1_Ex_NEU";"T1_Te_NEU";"T1_Vr_NEU";"T1_Na_NEU";"T1_NEU";"T1_Xx_mean_NEU";"T1_Xx_sd_NEU";"T1_ANG";"UNUSED_PLACEHOLDER_T1_INT";"UNUSED_PLACEHOLDER_T1_BEN";"UNUSED_PLACEHOLDER_T1_NUT";"UNUSED_PLACEHOLDER_T1_SKE";"UNUSED_PLACEHOLDER_T1_ZUG";"UNUSED_PLACEHOLDER_T1_ITU";"T1_education";"T1_education_txt";"T1_education_distance";"T2_device";"T2_NEU";"T2_ANG";"T2_INT";"T2_BEN";"T2_NUT";"T2_SKE";"T2_ZUG";"T2_ITU";"T3_device";"T3_NEU";"T3_ANG";"T3_INT";"T3_BEN";"T3_NUT";"T3_SKE";"T3_ZUG";"T3_ITU" | |
"XX-0001";"XX";5;19;6;17;21;8;6;12.666666666666666;6.497862896539309;12;-3;-3;-3;-3;-3;-3;1;"";4;3;22;1;12;13;1;9;11;135;3;20;19;5;13;11;5;16;254 | |
"XX-0002";"XX";1;23;6;10;5;24;5;11.5;8.88350531415762;24;-3;-3;-3;-3;-3;-3;2;"";3;5;27;13;20;8;7;19;12;98;5;21;6;5;21;1;27;6;64 | |
"XX-0003";"XX";5;23;13;8;14;24;14;14.5;7.041543391425869;25;-3;-3;-3;-3;-3;-3;0;"";3;5;6;13;6;15;23;11;16;276;5;28;7;9;21;19;22;15;56 | |
"XX-0004";"XX";11;26;2;8;11;23;23;13.5;8.381527307120106;28;-3;-3;-3;-3;-3;-3;4;" |