Git Product home page Git Product logo

barra_cne6's Introduction

Barra_CNE6

代码结构:

1.barra_template.py:

实现功能:

1)对文件夹内csv文件读取添加一层封装,以实现通过访问因子类的属性即可读取因子矩阵数据;

2)实现因子名称的模糊匹配并忽略其大小写;

2.barra_CNE6_factor.py:

实现功能:

使用dask库,对原始矩阵数据进行批量并行计算,生成CNE6日频因子数据。

说明:

1.一致预期类因子考虑数据源的缺失,暂时未考虑计算,考虑到指数成分股的因子覆盖度较高,后续考虑在沪深300、上证50指数增强模型中添加对应因子;

2.相关数据如有需求,请联系本人;

联系方式:

wechat:13821369426

tencent qq: 450359526

barra_cne6's People

Contributors

shiliangzhang-nku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

barra_cne6's Issues

barra_CNE6_factor.py的821行是否有误?

我模拟了从810行开始到821行的逻辑,3支股票,2天的数据,构造了3个df:rs ,cap_sqrt ,ind_citic_lv1
以下这段代码除了构造df,其余都是源代码一样
`import numpy as np
import pandas as pd
'''构造数据'''
rs = pd.DataFrame(np.arange(6).reshape(2, 3), index=('20201201','20201202'), columns=('000001','600039','600519'))
cap_sqrt = pd.DataFrame(np.arange(6).reshape(2, 3)*0.1, index=('20201201','20201202'), columns=('000001','600039','600519'))
ind_citic_lv1 = pd.DataFrame(np.ones(6).reshape(2, 3), index=('20201201','20201202'), columns=('000001','600039','600519'))
ind_citic_lv1.iloc[:,1] = 0
'''以下同源代码'''
dat = pd.DataFrame()
for df in [rs, cap_sqrt, ind_citic_lv1]:
df.index.name = 'time'
df.columns.name = 'code'
dat = pd.concat([dat, df.unstack()], axis=1)

dat.columns = ['rs', 'weight', 'ind']
dat = dat.reset_index()
'''这里会报错'''
rs_ind = {(time, ind): (df['weight'] * df['rs']).sum() / df['weight'].sum()
for time, df_gp in dat.groupby(['time'])
for ind, df in df_gp.groupby(['ind'])}`
代码运行到rs_ind行报错,提示应该是找不到time索引,在执行dat.reset_index()之后,我查看了下dat,如下图
time和code索引在reset_index之后都不见了,是我理解有问题吗?
image

Enhancement in Performance by Using Dask?

Hi author, I am studying your project and noticed that you use dask in your project to process factor matrix in parallel. But the fact is that the data file storing the daily frequency ticker data and the earnings data should not take up a lot of space. Since my data processing device does not have many cores for parallel computation, I would like to know if the performance difference between using dask and not using it is significant?

dask 版本

您好,方便告知下dask版本吗?新版本有些code已经不兼容了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.