@@ -764,8 +764,8 @@ def groups(self) -> dict[Hashable, np.ndarray]:
764
764
2023-02-01 3
765
765
2023-02-15 4
766
766
dtype: int64
767
- >>> ser.resample('M ').groups
768
- {Timestamp('2023-01-31 00:00:00'): 2, Timestamp('2023-02-28 00:00:00'): 4}
767
+ >>> ser.resample('MS ').groups
768
+ {Timestamp('2023-01-01 00:00:00'): 2, Timestamp('2023-02-01 00:00:00'): 4}
769
769
"""
770
770
return self .grouper .groups
771
771
@@ -818,9 +818,9 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
818
818
2023-02-01 3
819
819
2023-02-15 4
820
820
dtype: int64
821
- >>> ser.resample('M ').indices
822
- defaultdict(<class 'list'>, {Timestamp('2023-01-31 00:00:00'): [0, 1],
823
- Timestamp('2023-02-28 00:00:00'): [2, 3]})
821
+ >>> ser.resample('MS ').indices
822
+ defaultdict(<class 'list'>, {Timestamp('2023-01-01 00:00:00'): [0, 1],
823
+ Timestamp('2023-02-01 00:00:00'): [2, 3]})
824
824
"""
825
825
return self .grouper .indices
826
826
@@ -1003,7 +1003,7 @@ def get_group(self, name, obj=None) -> DataFrame | Series:
1003
1003
2023-02-01 3
1004
1004
2023-02-15 4
1005
1005
dtype: int64
1006
- >>> ser.resample('M ').get_group('2023-01-31 ')
1006
+ >>> ser.resample('MS ').get_group('2023-01-01 ')
1007
1007
2023-01-01 1
1008
1008
2023-01-15 2
1009
1009
dtype: int64
@@ -1085,13 +1085,13 @@ def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]:
1085
1085
2023-02-01 3
1086
1086
2023-02-15 4
1087
1087
dtype: int64
1088
- >>> for x, y in ser.resample('M '):
1088
+ >>> for x, y in ser.resample('MS '):
1089
1089
... print(f'{x}\\ n{y}\\ n')
1090
- 2023-01-31 00:00:00
1090
+ 2023-01-01 00:00:00
1091
1091
2023-01-01 1
1092
1092
2023-01-15 2
1093
1093
dtype: int64
1094
- 2023-02-28 00:00:00
1094
+ 2023-02-01 00:00:00
1095
1095
2023-02-01 3
1096
1096
2023-02-15 4
1097
1097
dtype: int64
0 commit comments