克隆策略

编程题

In [3]:
'''1、使用lambda 语句定义函数实现两个变量x和y的加法运算'''
myfunc = lambda x,y: x+y
myfunc(3,2)
Out[3]:
5
In [ ]:
'''获取2021年10月15日的A股股票代码池,并按股票代码排序'''
DataSource('bar1d_CN_STOCK_A').read()
instruments = list(reversed(list(ranker_prediction.instrument[ranker_prediction.instrument.apply(
                lambda x: x in equities)])))
In [7]:
'''获取A股2021年10月14日的平台内置features_CN_STOCK_A_G311因子表数据,并查看数据和因子列'''
df = DataSource("features_CN_STOCK_A_G311").read(start_date="2021-10-14", end_date="2021-10-14")
df.head()
Out[7]:
rank_beta_sse50_30_0 rank_amount_81 rank_avg_turn_210 rank_beta_csi300_30_0 rank_amount_119 rank_return_360 rank_avg_turn_50 rank_return_80 rank_avg_amount_150 instrument ... rank_amount_44 rank_beta_gem_90_0 rank_beta_csi100_120_0 rank_amount_102 rank_beta_industry_60_0 rank_amount_71 rank_beta_industry1_10_0 rank_avg_turn_90 rank_beta_sse50_90_0 rank_amount_54
0 0.985589 0.980347 0.059374 0.956316 0.987494 0.759799 0.082120 0.115838 0.981570 000001.SZA ... 0.958966 0.545729 0.989136 0.979225 0.956810 0.973569 0.871732 0.059424 0.992572 0.968529
1 0.869624 0.979884 0.173688 0.742400 0.986078 0.256886 0.212693 0.230520 0.983006 000002.SZA ... 0.957833 0.060817 0.902929 0.984360 0.964351 0.972190 0.855866 0.181291 0.938951 0.969897
2 0.319297 0.635376 0.867701 0.254898 0.615857 0.087924 0.798681 0.129249 0.559837 000004.SZA ... 0.760825 0.856778 0.653283 0.320495 0.852377 0.623305 0.599777 0.906917 0.399954 0.878905
3 0.161675 0.069595 0.313624 0.138708 0.205521 0.163665 0.323476 0.783584 0.173767 000005.SZA ... 0.179551 0.011606 0.078413 0.272409 0.170704 0.232360 0.144358 0.353760 0.080316 0.470011
4 0.499437 0.244624 0.097807 0.495609 0.507315 0.431144 0.090082 0.254566 0.236716 000006.SZA ... 0.177737 0.186630 0.473547 0.444911 0.370430 0.236727 0.222346 0.077994 0.511374 0.276853

5 rows × 232 columns