def advanced(out, *files): matrix, min_d, min_m = File._make_matrix(files) matrix = list(zip(*matrix)) data = File._advanced_matrix(matrix, min_d) out_data = list() for values in data: temp_dict = dict() for i, value in enumerate(values): if i < min_d: temp_dict["D{}".format(i + 1)] = value else: temp_dict["MS{}".format(i + 1 - min_d)] = value out_data.append(temp_dict) with open(out, 'w') as outfile: json.dump({"fields": out_data}, outfile)
def advanced(out, *files): matrix, min_d, min_m = CSV._make_matrix(files) matrix = list(zip(*matrix)) out_data = File._advanced_matrix(matrix, min_d) # записываем файл CSV._write_to_file(out, out_data, min_d, min_m, name_m="MS")
def advanced(out, *files): matrix, min_d, min_m = XML._make_matrix(files) matrix = list(zip(*matrix)) matrix = File._advanced_matrix(matrix, min_d) XML._write_to_file(out, matrix, min_d, min_m, name_m="MS")