File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -668,11 +668,15 @@ def groups(self) -> dict[Hashable, Index]:
668
668
cats = Categorical .from_codes (codes , uniques , validate = False )
669
669
return self ._index .groupby (cats )
670
670
671
- @cache_readonly
671
+ @property
672
672
def observed_grouping (self ) -> Grouping :
673
673
if self ._observed :
674
674
return self
675
675
676
+ return self ._observed_grouping
677
+
678
+ @cache_readonly
679
+ def _observed_grouping (self ) -> Grouping :
676
680
grouping = Grouping (
677
681
self ._index ,
678
682
self ._orig_grouper ,
Original file line number Diff line number Diff line change @@ -823,11 +823,15 @@ def result_index_and_ids(self) -> tuple[Index, npt.NDArray[np.intp]]:
823
823
824
824
return result_index , ids
825
825
826
- @cache_readonly
826
+ @property
827
827
def observed_grouper (self ) -> BaseGrouper :
828
828
if all (ping ._observed for ping in self .groupings ):
829
829
return self
830
830
831
+ return self ._observed_grouper
832
+
833
+ @cache_readonly
834
+ def _observed_grouper (self ) -> BaseGrouper :
831
835
groupings = [ping .observed_grouping for ping in self .groupings ]
832
836
grouper = BaseGrouper (self .axis , groupings , sort = self ._sort , dropna = self .dropna )
833
837
return grouper
@@ -1163,7 +1167,7 @@ def groupings(self) -> list[grouper.Grouping]:
1163
1167
)
1164
1168
return [ping ]
1165
1169
1166
- @cache_readonly
1170
+ @property
1167
1171
def observed_grouper (self ) -> BinGrouper :
1168
1172
return self
1169
1173
You can’t perform that action at this time.
0 commit comments