80db134405f0907c2c9a8e6149f534ff76653596,QUANTAXIS/QAARP/QAAccount.py,QA_Account,daily_hold,#QA_Account#,655
Before Change
data = data.set_index(["date", "account_cookie"])
res = data[~data.index.duplicated(keep="last")].sort_index()
// 这里会导致股票停牌时的持仓也被计算 但是计算market_value的时候就没了
return pd.concat([res.reset_index().set_index("date"), pd.Series(data=None, index=pd.to_datetime(self.trade_range).set_names("date"), name="predrop")], axis=1)\
.ffill().drop(["predrop"], axis=1).reset_index().set_index(["date", "account_cookie"]).sort_index()
After Change
data = data.set_index(["date", "account_cookie"])
res = data[~data.index.duplicated(keep="last")].sort_index()
// 这里会导致股票停牌时的持仓也被计算 但是计算market_value的时候就没了
return pd.concat([res.reset_index().set_index("date"), pd.Series(data=None, index=pd.to_datetime(self.trade_range).set_names("date"), name="predrop")], axis=1)\
.ffill().fillna(0).drop(["predrop","account_cookie"], axis=1).reset_index().set_index(["date"]).sort_index()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 80db134405f0907c2c9a8e6149f534ff76653596
Time: 2019-03-29
Author: 40067351+zsl3034669@users.noreply.github.com
File Name: QUANTAXIS/QAARP/QAAccount.py
Class Name: QA_Account
Method Name: daily_hold
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 80db134405f0907c2c9a8e6149f534ff76653596
Time: 2019-03-29
Author: 40067351+zsl3034669@users.noreply.github.com
File Name: QUANTAXIS/QAARP/QAAccount.py
Class Name: QA_Account
Method Name: daily_cash
Project Name: CamDavidsonPilon/lifelines
Commit Name: 79367410b43a54f3fc7674067fa962ed55b1d6bb
Time: 2020-05-16
Author: cam.davidson.pilon@gmail.com
File Name: lifelines/fitters/npmle.py
Class Name:
Method Name: reconstruct_survival_function