Skip to content

Commit 1b8547f

Browse files
committed
join=False
1 parent ae99aaa commit 1b8547f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/nested_pandas/utils/utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ def count_nested(df, nested, by=None, join=True) -> NestedFrame:
4242
`count_nested` also allows counting by a given subcolumn, for example we
4343
can count by "band" label:
4444
45-
>>> count_nested(nf, "nested", by="band")
46-
a b nested n_nested_g n_nested_r
47-
0 0.417022 0.184677 [{t: 8.38389, flux: 10.233443, band: 'g'}; …] ... 8 2
48-
1 0.720324 0.372520 [{t: 13.70439, flux: 41.405599, band: 'g'}; …]... 5 5
49-
2 0.000114 0.691121 [{t: 4.089045, flux: 69.440016, band: 'g'}; …]... 5 5
50-
3 0.302333 0.793535 [{t: 17.562349, flux: 41.417927, band: 'g'}; …... 6 4
51-
4 0.146756 1.077633 [{t: 0.547752, flux: 4.995346, band: 'r'}; …] ... 6 4
45+
>>> # join=False, allows the result to be kept separate from the original nf
46+
>>> count_nested(nf, "nested", by="band", join=False)
47+
band n_nested_g n_nested_r
48+
0 8 2
49+
1 5 5
50+
2 5 5
51+
3 6 4
52+
4 6 4
5253
"""
5354

5455
if by is None:

0 commit comments

Comments
 (0)