-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
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
Representing NA values #15
Comments
Hey @zhengyangfeng00, I like the idea! Definitely an omission from the library in it's current state. How would you feel about collaborating on this? If you send me a PR i'm happy to look at it, otherwise, i'll try to address this as soon as I have time |
I'm happy to work on a PR. I'm experimenting with a very simple implementation:
and it worked fine with my use cases. I basically have all indicators be aware of this NaN value. Essentially if an indicator depends on another one, then in its The majority of work I image is to update all existing indicators to behave similar? |
@zhengyangfeng00 Since this is more of a feature of big, i've moved this ticket here: |
Hi! I think it's useful to have a special NA or NaN value to represent the case where a value cannot be calculated. Other popular data analysis libraries such like numpy/pandas all have it.
One use case is that I want to calculate the difference between today's close price and yesterday's close price for each candle in the time series. Then I want to do
dif := techan.NewDifferenceIndicator(today, NewRefIndicator(yday, 1))
but if I accidentally calldif.Calculate(0)
it will segfault.I think we can workaround this problem by other means but I feel the most natural way is to add a NA value. What's your thoughts on this?
The text was updated successfully, but these errors were encountered: