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.normalize() and DatetimeIndex.strftime() #2089

Merged
merged 2 commits into from
Mar 6, 2021

Conversation

xinrong-meng
Copy link
Contributor

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

>>> idx = ks.date_range(start='2014-08-01 10:00', freq='H', periods=3)
>>> idx.normalize()
DatetimeIndex(['2014-08-01', '2014-08-01', '2014-08-01'], dtype='datetime64[ns]', freq=None)

>>> idx = ks.date_range(pd.Timestamp("2018-03-10 09:00"), periods=3, freq='s')
>>> idx.strftime('%B %d, %Y, %r')  # doctest: +NORMALIZE_WHITESPACE
Index(['March 10, 2018, 09:00:00 AM', 'March 10, 2018, 09:00:01 AM',
       'March 10, 2018, 09:00:02 AM'],
      dtype='object')

@codecov-io
Copy link

codecov-io commented Mar 5, 2021

Codecov Report

Merging #2089 (282dbc7) into master (2e6094b) will decrease coverage by 3.43%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2089      +/-   ##
==========================================
- Coverage   95.28%   91.84%   -3.44%     
==========================================
  Files          57       57              
  Lines       13223    13115     -108     
==========================================
- Hits        12600    12046     -554     
- Misses        623     1069     +446     
Impacted Files Coverage Δ
databricks/koalas/missing/indexes.py 100.00% <ø> (ø)
databricks/koalas/indexes/datetimes.py 96.69% <100.00%> (-1.60%) ⬇️
databricks/koalas/tests/indexes/test_datetime.py 96.96% <100.00%> (-3.04%) ⬇️
databricks/koalas/plot/plotly.py 15.78% <0.00%> (-81.06%) ⬇️
...bricks/koalas/tests/plot/test_frame_plot_plotly.py 23.33% <0.00%> (-76.67%) ⬇️
...ricks/koalas/tests/plot/test_series_plot_plotly.py 26.92% <0.00%> (-71.26%) ⬇️
databricks/koalas/typedef/typehints.py 79.88% <0.00%> (-14.53%) ⬇️
databricks/koalas/__init__.py 78.66% <0.00%> (-13.34%) ⬇️
databricks/koalas/accessors.py 86.43% <0.00%> (-7.04%) ⬇️
databricks/conftest.py 94.54% <0.00%> (-5.46%) ⬇️
... and 26 more

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 2e6094b...282dbc7. Read the comment docs.

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.

@ueshin
Copy link
Collaborator

ueshin commented Mar 6, 2021

Thanks! merging.

@ueshin ueshin merged commit 54a9502 into databricks:master Mar 6, 2021
@xinrong-meng
Copy link
Contributor Author

Thank you!

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