Yangami

导航

 

2021年6月1日

摘要: #获取指定周期的日期列表 'W、M、Q' def get_period_date(peroid,start_date, end_date): #设定转换周期period_type 转换为周是'W',月'M',季度线'Q',五分钟'5min',12天'12D' stock_data = get_pri 阅读全文
posted @ 2021-06-01 22:35 Yangami 阅读(46) 评论(0) 推荐(0) 编辑
 
摘要: def qujizhi(data): Qu,Ql=np.percentile(data,0.75),np.percentile(data,0.25) a_min,a_max=Ql-1.5*(Qu-Ql),Qu+1.5*(Qu-Ql) data=np.clip(data,a_min,a_max) re 阅读全文
posted @ 2021-06-01 20:32 Yangami 阅读(65) 评论(0) 推荐(0) 编辑
 
摘要: dic={} for st in set([i[0] for i in pd.Panel(df_factor_pre_train).to_frame().index.tolist()]): df=pd.Panel(df_factor_pre_train).to_frame().query('code 阅读全文
posted @ 2021-06-01 20:30 Yangami 阅读(83) 评论(0) 推荐(0) 编辑
 

2020年12月25日

摘要: df.resample('1h',on='news_time').sum().emo 阅读全文
posted @ 2020-12-25 21:45 Yangami 阅读(162) 评论(0) 推荐(0) 编辑
 

2020年12月10日

摘要: np.random.permutation(len(df)) 随机训练样本的方法 阅读全文
posted @ 2020-12-10 22:01 Yangami 阅读(112) 评论(0) 推荐(0) 编辑
 
摘要: 1 if not p1.empty: 2 pass 3 else: 4 p1_weekend = datetime.fromtimestamp(unix-unix_weekend).strftime("%Y-%m-%d") 5 p1 = get_price(index[each],start_dat 阅读全文
posted @ 2020-12-10 21:30 Yangami 阅读(771) 评论(0) 推荐(0) 编辑
 

2020年9月27日

摘要: for k , v in dic.items(): print(k,v) 这种办法速度慢 阅读全文
posted @ 2020-09-27 14:38 Yangami 阅读(100) 评论(0) 推荐(0) 编辑
 
摘要: 文档中如是写: Panel.dropna(axis=0, how='any', inplace=False) Drop 2D from panel, holding passed axis constant. Parameters: axis : int, default 0 Axis to hol 阅读全文
posted @ 2020-09-27 11:15 Yangami 阅读(122) 评论(0) 推荐(0) 编辑
 

2019年6月7日

摘要: 本地代码是.ipynb格式的转换到博客上很麻烦,这里展示部分代码,了解更多可以查看我的git-hub:https://github.com/Yangami/Python-for-Statisticians/tree/master/Numpy 股票数据分析 股票数据分析 股票数据分析 股票数据分析 任 阅读全文
posted @ 2019-06-07 08:48 Yangami 阅读(421) 评论(0) 推荐(0) 编辑
 
摘要: 一、基本类型 用列表、数组和字典构建series 文件中有给统计人讲Python(2)_Pandas入门有完整代码和实例及其数据 阅读全文
posted @ 2019-06-07 08:39 Yangami 阅读(189) 评论(0) 推荐(0) 编辑