Commit aa00a077 authored by 赵杰's avatar 赵杰

收益率0

parent 48fc6aa5
......@@ -23,7 +23,11 @@ def simple_return(net_worth):
简单收益率
net_worth:净值或指数数据
"""
d = net_worth / net_worth.shift(1) - 1
try:
d = net_worth / net_worth.shift(1) - 1
except:
net_worth.iloc[0] = 0
return net_worth
d.iloc[0] = 0
return d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment