对给出的txt文件表格中某几列进行API绘制
在此,我使用红色实线表示Positive Evidence,黑色实线表示Negative Evidence,绿色实线表示Neutral Evidence。
#-*- coding:utf-8 -*-
import matplotlib.pyplot as plt
import pandas as pd
from pandas import *
# 由于此文件中有60000多个数据,所以我采用每per行求一个平均值,使得数据展现得更加直观
def average(seq, total=0.0):
num = 0
ave = 0.0
per = 600
xx = []
for item in seq:
if (num+1)%per != 0 or (num+1)/per==0:
total += item
else:
ave = total / num
total =0.0
xx.append(ave)
num += 1
if num == per:
num = 0
return xx
df = pd.re