We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_price_index
to_returns
Hi,
Great job you have done here.
I have realized that the methods to_price_index and to_returns have a round-trip problem.
It is due to the fact that to_price_index is not including the start parameter it takes as an argument in the first value of the returned prices.
start
import ffn import numpy as np ffn.extend_pandas() ret_ss = pd.Series(np.random.randn(100)) prices_ss = ret_ss.to_price_index(start = 100) ret_ss.head() # 0 -0.934990 # 1 -0.017586 # 2 -0.116771 # 3 -0.474929 # 4 0.566763 # dtype: float64 prices_ss.head() # 0 6.500992 # 1 6.386665 # 2 5.640886 # 3 2.961868 # 4 4.640544 # dtype: float64 # The first value is using the first return, it is not start! assert prices_ss[0] == (100 * (ret_ss[0] + 1)) # No round trip prices_ss.to_returns().head() # 0 NaN # 1 -0.017586 # 2 -0.116771 # 3 -0.474929 # 4 0.566763 # dtype: float64
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Great job you have done here.
I have realized that the methods
to_price_index
andto_returns
have a round-trip problem.It is due to the fact that
to_price_index
is not including thestart
parameter it takes as an argument in the first value of the returned prices.Minimal working example
The text was updated successfully, but these errors were encountered: