利用sklearn的svm预测趋势 数据准备 模型训练和预测 数据准备 def get_data(code,start,end,window_len=20): ts_pro=ts.pro_api('xx') df=ts_pro.daily(ts_code=code,start_date=start,end_date=end,fields='ts_code,trade_date,open,close') df=df.reindex(index=df