#计算因子暴露的标准方式是最小二乘回归, 可以使用pandas.ols
pd.ols(y=port, x=factors).beta
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2881: FutureWarning: The pandas.stats.ols module is deprecated and will be removed in a future version. We refer to external packages like statsmodels, see some examples here: http://www.statsmodels.org/stable/regression.html
exec(code_obj, self.user_global_ns, self.user_ns)