File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -4734,6 +4734,10 @@ cpdef to_offset(freq, bint is_period=False):
4734
4734
Parameters
4735
4735
----------
4736
4736
freq : str, datetime.timedelta, BaseOffset or None
4737
+ The frequency represented.
4738
+ is_period : bool, default False
4739
+ Convert string denoting period frequency to corresponding offsets
4740
+ frequency if is_period=True.
4737
4741
4738
4742
Returns
4739
4743
-------
@@ -4768,6 +4772,17 @@ cpdef to_offset(freq, bint is_period=False):
4768
4772
4769
4773
>>> to_offset(pd.offsets.Hour())
4770
4774
<Hour>
4775
+
4776
+ Passing the parameter ``is_period`` equal to True, you can use a string
4777
+ denoting period frequency:
4778
+
4779
+ >>> freq = to_offset(freq="ME", is_period=False)
4780
+ >>> freq.rule_code
4781
+ 'ME'
4782
+
4783
+ >>> freq = to_offset(freq="M", is_period=True)
4784
+ >>> freq.rule_code
4785
+ 'ME'
4771
4786
"""
4772
4787
if freq is None :
4773
4788
return None
You can’t perform that action at this time.
0 commit comments