Skip to content
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

Add possibility to add fill values on arithmetic operations #191

Open
jecisc opened this issue Mar 15, 2023 · 1 comment
Open

Add possibility to add fill values on arithmetic operations #191

jecisc opened this issue Mar 15, 2023 · 1 comment

Comments

@jecisc
Copy link
Member

jecisc commented Mar 15, 2023

It is possible to do operations such as divide between 2 DataSeries. In the case of a DataSerie containing nils, we consider that the return of the operation should be nil.

	| a b c |
	a := #( 2 4 nil ) asDataSeries.
	b := #( 1 nil 3 ) asDataSeries.
	c := #( 2 nil nil ) asDataSeries.

In some case the user might want to give a fill value instead of using nil. I propose that we add methods like #divide:fillValue: or #add:fillValue: that would use the fillValue in case we have a nil.

fillValue: nil or float value, default nil

Fill existing missing (nil) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing the result of filling (at that location) will be missing.

@olekscode
Copy link
Member

I would rather handle the "sent to nil" exception in those cases. Or use a combination of two methods: fillNil and the arithmetic operation. Otherwise we would need to provide a special method for each operation and it would become ugly... Also fillNil is not the only preprocessing that we might need to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants