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

Implement DatetimeIndex.indexer_between_time() #2104

Merged
merged 12 commits into from
Mar 19, 2021

Conversation

xinrong-meng
Copy link
Contributor

@xinrong-meng xinrong-meng commented Mar 15, 2021

Implement DatetimeIndex.indexer_between_time()

>>> kidx = ks.date_range("2000-01-01", periods=3, freq="T")
>>> kidx 
DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:01:00',
               '2000-01-01 00:02:00'],
              dtype='datetime64[ns]', freq=None)
>>> kidx.indexer_between_time("00:01", "00:02").sort_values()
Int64Index([1, 2], dtype='int64')
>>> kidx.indexer_between_time("00:01", "00:02", include_end=False).sort_values()
Int64Index([1], dtype='int64')
>>> kidx.indexer_between_time("00:01", "00:02", include_start=False).sort_values()
Int64Index([2], dtype='int64')

@codecov-io
Copy link

codecov-io commented Mar 17, 2021

Codecov Report

Merging #2104 (3cbb5d0) into master (2fe8796) will decrease coverage by 0.05%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2104      +/-   ##
==========================================
- Coverage   95.21%   95.16%   -0.06%     
==========================================
  Files          60       60              
  Lines       13460    13459       -1     
==========================================
- Hits        12816    12808       -8     
- Misses        644      651       +7     
Impacted Files Coverage Δ
databricks/koalas/missing/indexes.py 100.00% <ø> (ø)
databricks/koalas/indexes/datetimes.py 96.32% <92.30%> (-2.08%) ⬇️
databricks/koalas/tests/indexes/test_datetime.py 97.67% <100.00%> (-2.33%) ⬇️
databricks/koalas/typedef/typehints.py 89.07% <0.00%> (-5.50%) ⬇️
databricks/koalas/tests/indexes/test_category.py 98.21% <0.00%> (-1.79%) ⬇️
databricks/koalas/internal.py 95.75% <0.00%> (-0.93%) ⬇️
databricks/koalas/tests/indexes/test_base.py 99.38% <0.00%> (-0.62%) ⬇️
databricks/koalas/groupby.py 94.43% <0.00%> (+2.80%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fe8796...3cbb5d0. Read the comment docs.

@xinrong-meng xinrong-meng marked this pull request as ready for review March 17, 2021 20:02
databricks/koalas/indexes/datetimes.py Outdated Show resolved Hide resolved
databricks/koalas/indexes/datetimes.py Outdated Show resolved Hide resolved
databricks/koalas/indexes/datetimes.py Outdated Show resolved Hide resolved
databricks/koalas/indexes/datetimes.py Outdated Show resolved Hide resolved
databricks/koalas/tests/indexes/test_datetime.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending tests.

@ueshin
Copy link
Collaborator

ueshin commented Mar 19, 2021

The test result looks weird https://github.com/databricks/koalas/pull/2104/checks?check_run_id=2144103456.
Let me retrigger.

@ueshin
Copy link
Collaborator

ueshin commented Mar 19, 2021

Thanks! merging.

@ueshin ueshin merged commit 757ed1c into databricks:master Mar 19, 2021
@xinrong-meng
Copy link
Contributor Author

Thanks, @ueshin !

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

Successfully merging this pull request may close these issues.

3 participants