Conversation
| foreach(a, b; lockstep(indx.row.index, indx.row.codes)) | ||
| { | ||
| ret.indx.row.index ~= a; | ||
| ret.indx.row.codes ~= dropper(positions, b); |
There was a problem hiding this comment.
in general try to avoid doing allocations in a loop, in particular this can be refactored to
ret.indx.row.index = indx.row.index.dup;
ret.indx.row.codes = indx.row.codes.map!((e) => dropper(positions, e)).array.
| Returns: | ||
| Filtered DataFrame | ||
| +/ | ||
| auto filter(alias filterFunc)() @property |
There was a problem hiding this comment.
is there any particular reason why you can't use https://dlang.org/phobos/std_algorithm_iteration.html#.filter ?
Owner
Author
There was a problem hiding this comment.
It was mainly due to difference in data type of Homogeneous and Heterogeneous DataFrame.
Filter the rows of a dataframe based on the values returned by the alias function
* Fixed imports of aggregate * Added filter documentation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The comparison with
homogeneousbranch is intentional to avoid unnecessarily long diffs. Once #11 is merged, I'll change the PR to point to master.This was necessary as the homogeneous optimisation isn't in master yet.
Cc/ @thewilsonator