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

Added DataSeries fillNilsWith method #103

Merged
merged 1 commit into from Jul 11, 2019

Conversation

@AtharvaKhare
Copy link
Contributor

@AtharvaKhare AtharvaKhare commented Jun 19, 2019

TODO: Add methods for filling with Mean, Mode and Median. This is dependent upon the PR #102, since it will make the code shorter.

@olekscode
Copy link
Member

@olekscode olekscode commented Jun 21, 2019

DataSeries >> fillNilsWith: anObject [
	"Fills nils inplace with anObject"

 	self withIndexDo: [ :ele :index |
		ele isNil
			ifTrue: [ self atIndex: index put: anObject ]
			ifFalse: [ self atIndex: index put: ele ] ]

ifFalse: part is not needed. But it takes time.
Remove it:

DataSeries >> fillNilsWith: anObject [
	"Fills nils inplace with anObject"

 	self withIndexDo: [ :ele :index |
		ele isNil
			ifTrue: [ self atIndex: index put: anObject ] ]

Loading

Also added relevant tests
@olekscode olekscode merged commit ffbd70b into PolyMathOrg:master Jul 11, 2019
3 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants