import pandas as pd import numpy as np import matplotlib.pyplot as plt #读取数据 data=pd.read_csv('C:/Users/Administrator/Desktop/rb000.csv',encoding='gbk') data=data.iloc[::,:7] data.columns=['time','oepn','high','low','close','amt','opi'] #处理数据 data['mid']=data['close'].rolling(26).mean() data['tmp2']=data['close'].rolling(20).std() data['top']=data['mid']+2*data['tmp2'] data['bottom']=data['mid']-2*data['tmp2'] #data.tail()