Skip to content

Commit 3a9892d

Browse files
committed
Refinements
1 parent c82bd65 commit 3a9892d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pandas/core/groupby/groupby.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4440,6 +4440,7 @@ def post_processor(
44404440

44414441
ids, ngroups = self.grouper.group_info
44424442
if self.dropna:
4443+
# splitter drops NA groups, we need to do the same
44434444
ids = ids[ids >= 0]
44444445
nqs = len(qs)
44454446

pandas/core/groupby/ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,10 +998,11 @@ def apply_groupwise(
998998
# Methods for sorting subsets of our GroupBy's object
999999

10001000
@final
1001-
@property
1001+
@cache_readonly
10021002
def _sorted_ids(self) -> npt.NDArray[np.intp]:
10031003
result = self.ids.take(self.result_ilocs)
10041004
if getattr(self, "dropna", True):
1005+
# BinGrouper has no dropna
10051006
result = result[result >= 0]
10061007
return result
10071008

pandas/core/reshape/pivot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,6 @@ def crosstab(
717717
margins=margins,
718718
margins_name=margins_name,
719719
dropna=dropna,
720-
# TODO: Not sure if this is okay
721-
observed=dropna,
722720
**kwargs, # type: ignore[arg-type]
723721
)
724722

0 commit comments

Comments
 (0)