temp数据预处理--以24h为周期的噪声的序列
1.按照周期来截取数据
从数据库加载下来的是以5min取一次mean()的列,因此24h应取了24*60/5=288次数据
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。首先把这8352个数据(最后一个以倒数第二个填充)改成288*30的形式
txt=open('my_data.csv','r')
txt1=open('new_data.csv','w')
temp=[]
for line in txt.readlines():
line=line.strip('\n')
temp.append(line)
j=1
n=288
while n:
s=[]
for i in range(len(temp)):
if (i+1)%288 == j:
s.append(temp[i])
else:
pass
for k in s:
txt1.write(k)
txt1.write(',')
j=j+1
n=n-1
if j==288:
s=[]
txt1.write('\n')
for i in range(len(temp)):
if (i+1)%288 ==0:
s.append(temp[i])
else:
pass
for k in s:
txt1.write(k)
txt1.write(',')
else:
pass
txt1.write('\n')
txt.close()
txt1.close()
2.缺失值和异常处理
https://blog.csdn.net/wangxingfan316/article/details/79363420
3.降噪
https://www.douban.com/note/698037655/?type=like
更多精彩

