import pandas as pd
import numpy as np
data = pd.read_csv(r'progress_symmetry_track0.01.csv')
data2 = pd.read_csv(r'progress_no_symmetry_track0.01.csv')
data3 = pd.read_csv(r'progress_no_symmetry_track0.01.csv')
print(data.columns)#获取列索引值
print(data.index)#获取行索引值

res1  = data['EpRewMean'] #获取名字为flow列的数据
res2 = data2['EpRewMean']
res3 = data3['EpRewMean']
data_list1 = res1.values.tolist()#将csv文件中flow列中的数据保存到列表中
data_list2 = res2.values.tolist()#将csv文件中flow列中的数据保存到列表中
data_list3 = res3.values.tolist()#将csv文件中flow列中的数据保存到列表中
#for j in range(len(data_list3)):
#    data_list2.append(data_list3[j])
#print(data)
shape1 = np.array(data_list1).shape[0]
shape2 = np.array(data_list2).shape[0]
shape3 = np.array(data_list3).shape[0]
print(shape1)
min_shape = shape1
print(shape2)
#print(shape3)
if shape1>shape2:
    min_shape = shape2
else:
    min_shape = shape1
if min_shape>shape3:
   min_shape = shape3

import matplotlib.pyplot as plt
plt.plot(data_list1[:min_shape],label='Symmetry')
plt.plot(data_list2[:min_shape],label='No-Symmetry')
# plt.plot(data_list3[:min_shape],label='max_step-0.02')
plt.legend(loc='upper left')
plt.xlabel('Iteration')
plt.ylabel('EpRewMean')
plt.legend(loc=2)
plt.show()
# plt.savefig('Comparison_weight_parameters_reward_true.svg',dpi=600,format='svg')