Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ENH: New accessor for Index len #809

Merged
merged 5 commits into from
Dec 20, 2022
Merged

ENH: New accessor for Index len #809

merged 5 commits into from
Dec 20, 2022

Conversation

Zeroto521
Copy link
Owner

@Zeroto521 Zeroto521 commented Dec 20, 2022

  • closes #xxxx
  • whatsnew entry

Similar to Series.len accessor

    >>> import dtoolkit
    >>> import pandas as pd
    >>> index = pd.Index([0, 1.5, "str", ("tuple",), ["list"], {}, object])
    >>> index
    Index([0, 1.5, 'str', ('tuple',), ['list'], {}, <class 'object'>], dtype='object')
    >>> index.len()
    Float64Index([1.0, 1.0, 3.0, 1.0, 1.0, 0.0, nan], dtype='float64')

@codecov
Copy link

codecov bot commented Dec 20, 2022

Codecov Report

Merging #809 (825be4c) into main (7f84090) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #809   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files         141      142    +1     
  Lines        1976     1984    +8     
  Branches      428      429    +1     
=======================================
+ Hits         1970     1978    +8     
  Misses          1        1           
  Partials        5        5           
Impacted Files Coverage Δ
dtoolkit/accessor/index/__init__.py 100.00% <100.00%> (ø)
dtoolkit/accessor/index/len.py 100.00% <100.00%> (ø)
dtoolkit/accessor/series/len.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Zeroto521 Zeroto521 enabled auto-merge (squash) December 20, 2022 12:13
@Zeroto521 Zeroto521 merged commit b3f8c39 into main Dec 20, 2022
@Zeroto521 Zeroto521 deleted the accessor/index/len branch December 20, 2022 12:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant