Skip to content

Commit cc63476

Browse files
authored
Added an example for infer_freq (#39558)
1 parent 5794002 commit cc63476

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tseries/frequencies.py

+6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ def infer_freq(index, warn: bool = True) -> Optional[str]:
145145
If the index is not datetime-like.
146146
ValueError
147147
If there are fewer than three values.
148+
149+
Examples
150+
--------
151+
>>> idx = pd.date_range(start='2020/12/01', end='2020/12/30', periods=30)
152+
>>> pd.infer_freq(idx)
153+
'D'
148154
"""
149155
import pandas as pd
150156

0 commit comments

Comments
 (0)