Dispatch iloc calls to getitem#6355
Merged
TomAugspurger merged 4 commits intodask:masterfrom Jun 30, 2020
Merged
Conversation
mrocklin
reviewed
Jun 29, 2020
dask/dataframe/indexing.py
Outdated
Comment on lines
+66
to
+70
| return self._getitem(cindexer) | ||
|
|
||
| def _getitem(self, cindexer): | ||
| col_names = self.obj.columns[cindexer] | ||
| return self.obj.__getitem__(col_names) |
Member
There was a problem hiding this comment.
Thoughts on inlining this method? If it's not going to be used elsewhere I wouldn't mind just sticking the two lines directly into the method above.
Contributor
Author
There was a problem hiding this comment.
happy to inline it, and it's unlikely to be used elsewhere.
Member
|
This PR may win the compute-hours-saved / lines-of-code contest |
Co-authored-by: Tom Augspurger <TomAugspurger@users.noreply.github.com>
Member
TomAugspurger
left a comment
There was a problem hiding this comment.
Can you add a couple sanity tests that the result of a df.iloc[:, ...] is correct with duplicate columns?
df.iloc[:, 0]with duplicate columns and different values for the columns with the same namedf.iloc[:, list_of_integers]selecting some duplicates and some non-duplicate columnsdf.iloc[:, negative_slice]
Contributor
Author
Added these tests with duplicate columns and without. |
Member
|
Thanks Gil |
4 tasks
8 tasks
kumarprabhu1988
pushed a commit
to kumarprabhu1988/dask
that referenced
this pull request
Oct 29, 2020
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.
black dask/flake8 daskAlternate solution to speeding up certain
iloccalls xref #6345 #6264This is a much smaller change and also provides a nice speedup for my simple local benchmarks:
timeseries parquet file created with dask.dataframe.demo with 4 columns and 34447680 rows
current master:
this branch: