-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way to speedup dataframe data imputing
- Loading branch information
Showing
2 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Extension { #name : #SequenceableCollection } | ||
|
||
{ #category : #'*AI-DataImputers' } | ||
SequenceableCollection >> copyReplace: missingValue in2DCollectionBy: arrayOfReplacementValues [ | ||
"I am a 2D collection and the goal is to return a copy replace the missing values by the values of my second parameter. The good value is the index of the missing value in the sub collection." | ||
|
||
^ self collect: [ :subColl | | ||
subColl withIndexCollect: [ :element :index | | ||
element = missingValue | ||
ifTrue: [ arrayOfReplacementValues at: index ] | ||
ifFalse: [ element ] ] ] | ||
] |