- 博客(11)
- 收藏
- 关注
原创 pd.ols(y=port, x=factors).beta
#计算因子暴露的标准方式是最小二乘回归, 可以使用pandas.olspd.ols(y=port, x=factors).betaC:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2881: FutureWarning: The pandas.stats.ols module is depreca
2017-08-29 15:03:37 3971 3
原创 excute selection in console 不执行解决
I also got this error, and it got resolved by setting the default working directory. Follow the below path, and set the Working Directory to the folder where your code resides.File > Settings > Build,
2017-08-17 16:46:04 1855
原创 pandas中merge,append,concat的用法
mergeIn [1]: import pandas as pdIn [2]: import numpy as npIn [3]: from pandas import DataFrameIn [6]: df1 = pd.DataFrame({'fund_id':[1,2,3],'statistic_date':[11,22,33],'benc ...: hmark':[111,222,33
2017-08-17 10:13:23 2499
原创 eval函数
nav_df = nav_df[eval("nav_df['statistic_date']{}min_time".format(">="))]nav_df = nav_df[nav_df['statistic_date'] <= max_time]
2017-08-14 15:15:22 508
原创 映射
>>> from collections import OrderedDict>>> nav_map = OrderedDict([(r'<','跌破'),(r'<=','跌破'),(r'>=','突破'),(r'>','突破')])>>>'跌破'>>>
2017-08-10 10:53:02 303
原创 np.random模块
标签:【说明】翻译自官网的文档。 随机抽样 (numpy.random)简单的随机数据 rand(d0, d1, …, dn)随机值>>> np.random.rand(3,2)array([[ 0.14022471, 0.96360618], #random [ 0.37601032, 0.25528411], #random [ 0.49313
2017-08-07 15:18:29 816
原创 对dataframe进行列相加,行相加
>>> import pandas as pd>>> df = pd.DataFrame({"x":['a','b','c','d'],"y":['aa','bb','cc','dd'],"z":['aaa','bbb','ccc','ddd']})>>> df x y z0 a aa aaa1 b bb bbb2 c cc ccc3 d dd d
2017-08-02 15:00:29 45142 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人