📜  在 python 代码示例中保存数据

📅  最后修改于: 2022-03-11 14:45:18.018000             🧑  作者: Mango

代码示例2
replicate = 5

with open("output_data" + str(replicate) + ".csv", "w") as out_file:
    for i in range(len(fitness_list)):
        out_string = ""
        out_string += str(fitness_list[i])
        out_string += "," + str(trait1_list[i])
        out_string += "," + str(trait2_list[i])
        out_string += "\n"
        out_file.write(out_string)