We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 658cdf6 commit 6a50022Copy full SHA for 6a50022
pandas/core/groupby/groupby.py
@@ -570,7 +570,8 @@ def groups(self) -> dict[Hashable, Index]:
570
2023-02-15 4
571
dtype: int64
572
>>> ser.resample("MS").groups
573
- {Timestamp('2023-01-01 00:00:00'): 2, Timestamp('2023-02-01 00:00:00'): 4}
+ {Timestamp('2023-01-01 00:00:00'): np.int64(2),
574
+ Timestamp('2023-02-01 00:00:00'): np.int64(4)}
575
"""
576
if isinstance(self.keys, list) and len(self.keys) == 1:
577
warnings.warn(
@@ -637,7 +638,7 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
637
638
toucan 1 5 6
639
eagle 7 8 9
640
>>> df.groupby(by=["a"]).indices
- {1: array([0, 1]), 7: array([2])}
641
+ {np.int64(1): array([0, 1]), np.int64(7): array([2])}
642
643
For Resampler:
644
0 commit comments