File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ Top-level dealing with datetimelike
158
158
bdate_range
159
159
period_range
160
160
timedelta_range
161
+ infer_freq
161
162
162
163
Top-level evaluation
163
164
~~~~~~~~~~~~~~~~~~~~
@@ -1364,6 +1365,7 @@ Time/Date Components
1364
1365
DatetimeIndex.is_quarter_end
1365
1366
DatetimeIndex.is_year_start
1366
1367
DatetimeIndex.is_year_end
1368
+ DatetimeIndex.inferred_freq
1367
1369
1368
1370
Selecting
1369
1371
~~~~~~~~~
@@ -1414,6 +1416,7 @@ Components
1414
1416
TimedeltaIndex.microseconds
1415
1417
TimedeltaIndex.nanoseconds
1416
1418
TimedeltaIndex.components
1419
+ TimedeltaIndex.inferred_freq
1417
1420
1418
1421
Conversion
1419
1422
~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ def freqstr(self):
79
79
80
80
@cache_readonly
81
81
def inferred_freq (self ):
82
+ """
83
+ Trys to return a string representing a frequency guess,
84
+ generated by infer_freq. Returns None if it can't autodetect the
85
+ frequency.
86
+ """
82
87
try :
83
88
return infer_freq (self )
84
89
except ValueError :
Original file line number Diff line number Diff line change @@ -671,11 +671,11 @@ def _period_str_to_code(freqstr):
671
671
def infer_freq (index , warn = True ):
672
672
"""
673
673
Infer the most likely frequency given the input index. If the frequency is
674
- uncertain, a warning will be printed
674
+ uncertain, a warning will be printed.
675
675
676
676
Parameters
677
677
----------
678
- index : DatetimeIndex
678
+ index : DatetimeIndex or TimedeltaIndex
679
679
if passed a Series will use the values of the series (NOT THE INDEX)
680
680
warn : boolean, default True
681
681
@@ -684,6 +684,7 @@ def infer_freq(index, warn=True):
684
684
freq : string or None
685
685
None if no discernible frequency
686
686
TypeError if the index is not datetime-like
687
+ ValueError if there are less than three values.
687
688
"""
688
689
import pandas as pd
689
690
You can’t perform that action at this time.
0 commit comments