本文整理汇总了Python中File.File.save方法的典型用法代码示例。如果您正苦于以下问题:Python File.save方法的具体用法?Python File.save怎么用?Python File.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类File.File
的用法示例。
在下文中一共展示了File.save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: zip
# 需要导入模块: from File import File [as 别名]
# 或者: from File.File import save [as 别名]
MAX_FITNESS.append(maximum_fitness)
MEAN_FITNESS.append(means_fitness)
ELITE_COUNTER_PER_EXECUTION.append(elite_counter)
if args.data_generated == 'MeanGeneration':
#Get the generation value
data = GENERATION_PER_EXECUTION
elif args.data_generated == 'SelectionPressure':
#Get the pressure
data = SELECTION_PRESURE
elif args.data_generated == 'EliteCounter':
#Get the elite counter
data = ELITE_COUNTER_PER_EXECUTION
elif args.data_generated == 'MaxFitness':
#Get the maximum values
ziped = zip(*MAX_FITNESS)
max_fitness = [sum(ls) for ls in ziped]
data = []
for maxi in max_fitness:
data.append(maxi/RANGE_OF_EXECUTION)
elif args.data_generated == 'MeanFitness':
#Get the means values
ziped = zip(*MEAN_FITNESS)
mean_fitness = [sum(ls) for ls in ziped]
data = []
for val in mean_fitness:
data.append(val/RANGE_OF_EXECUTION)
File.save(args.file_name, data)