收集到3D历史数据后,需要整理这些数据,为预测作参考。
一、准备,导入模块
import pandas as pd
import os
二、获取数据
#获取数据
def open_file(ccc):
global aa1,aa2,aa3,aadate,data,eee,data1,qq
data=pd.read_excel('d:\\yy'+ccc+'202192112811.xls')
aa1=data['hundreds']
aa2=data['tens']
aa3=data['ones']
aadate=data['date']
print('read file finished')
数据是之前收集好的,excel文件
三、计算冷热号
将百十个位号码合并,然后统计出现次数,排序,得到冷号热号。
#冷热号
def cool_number():
#print(aa1,aa2,aa3,aadate)
global aa1,aa2,aa3,aadate,data,eee,ww,qq
eee=pd.DataFrame(columns=['period','num