Repository: Zeroto521/my-data-toolkit

Issue:
MAINT: use `*.size` replace `len(*)`
<!--
Thanks for contributing a pull request!

Please follow these standard acronyms to start the commit message:

- ENH: enhancement
- BUG: bug fix
- DOC: documentation
- TYP: type annotations
- TST: addition or modification of tests
- MAINT: maintenance commit (refactoring, typos, etc.)
- BLD: change related to building
- REL: related to releasing
- API: an (incompatible) API change
- DEP: deprecate something, or remove a deprecated object
- DEV: development tool or utility
- REV: revert an earlier commit
- PERF: performance improvement
- BOT: always commit via a bot
- CI: related to CI or CD
- CLN: Code cleanup
-->

- [ ] closes #xxxx
- [x] whatsnew entry

`*.size` work for `pandas.(Index|Series|DataFrame)`.
And a little bit faster than `len`


Discussion:
# [Codecov](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) Report
> Merging [#664](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) (5ee8009) into [main](https://codecov.io/gh/Zeroto521/my-data-toolkit/commit/e82a7a2ac2f8e30a92d9a889e4c6f8600341ece4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) (e82a7a2) will **not change** coverage.
> The diff coverage is `100.00%`.

```diff
@@           Coverage Diff           @@
##             main     #664   +/-   ##
=======================================
  Coverage   99.43%   99.43%           
=======================================
  Files         106      106           
  Lines        1234     1234           
  Branches      115      115           
=======================================
  Hits         1227     1227           
  Misses          2        2           
  Partials        5        5           
```


| [Impacted Files](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) | Coverage Δ | |
|---|---|---|
| [dtoolkit/accessor/dataframe/decompose.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvYWNjZXNzb3IvZGF0YWZyYW1lL2RlY29tcG9zZS5weQ==) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/accessor/dataframe/top\_n.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvYWNjZXNzb3IvZGF0YWZyYW1lL3RvcF9uLnB5) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/accessor/dataframe/values\_to\_dict.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvYWNjZXNzb3IvZGF0YWZyYW1lL3ZhbHVlc190b19kaWN0LnB5) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/accessor/series/error\_report.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvYWNjZXNzb3Ivc2VyaWVzL2Vycm9yX3JlcG9ydC5weQ==) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/geoaccessor/geoseries/geobuffer.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/664/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvZ2VvYWNjZXNzb3IvZ2Vvc2VyaWVzL2dlb2J1ZmZlci5weQ==) | `97.50% <100.00%> (ø)` | |

:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero)


Resolving patch:
diff --git a/dtoolkit/accessor/dataframe/decompose.py b/dtoolkit/accessor/dataframe/decompose.py
--- a/dtoolkit/accessor/dataframe/decompose.py
+++ b/dtoolkit/accessor/dataframe/decompose.py
@@ -1,6 +1,5 @@
 from __future__ import annotations
 
-from itertools import chain
 from typing import Hashable
 from typing import TYPE_CHECKING
 
@@ -9,6 +8,7 @@
 
 from dtoolkit.accessor.dataframe.drop_or_not import drop_or_not
 from dtoolkit.accessor.register import register_dataframe_method
+from dtoolkit.accessor.series.expand import collapse
 
 if TYPE_CHECKING:
     from sklearn.base import TransformerMixin
@@ -163,12 +163,12 @@ def decompose(
                 ],
             ),
             index=df.index,
-            columns=chain.from_iterable(columns.keys()),
+            columns=collapse(columns.keys()),
         ).combine_first(
             drop_or_not(
                 df,
                 drop=drop,
-                columns=chain.from_iterable(columns.values()),
+                columns=collapse(columns.values()),
             ),
         )
 


Test patch: