import numpy as npimport pandas as pd def save_acc_std_results(data_mean, data_std, methods, tasks): from styleframe import Styleframe data_stat = np.zeros_like(data_mean, dtype='object') m, n = data_mean.shape for r in range(m): for c in range(n): data_stat[r, c] = '{:.2f}n({:.2f})'.format(data_mean[r,c]*100, data_std[r,c]*100) data_df = pd.Dataframe(data_stat, index= methods, columns=tasks) print(data_df) Styleframe(data_df).to_excel('Result_demo666.xlsx', index=True).save()if __name__=='__main__': methods = ['M01', 'M02', 'M03'] tasks = ['T01', 'MT2', 'T03', 'T04'] num_repeat = 5 num_method = len(methods) num_task = len(tasks) data = np.random.randn(num_repeat,num_method,num_task) data_mean = data.mean(axis=0) data_std = data.std(axis=0) save_acc_std_results(data_mean, data_std, methods, tasks)