-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
#21128 DOC: Add documentation for freq='infer' option of DatetimeIndex and TimedeltaIndex constructors #21201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
16452fc
3180573
efbd4d1
aec1037
daf1f86
e50abd3
35164d5
93163a6
38530b5
e1a80eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,17 @@ options like ``dayfirst`` or ``format``, so use ``to_datetime`` if these are req | |
|
||
pd.Timestamp('2010/11/12') | ||
|
||
You can also use the `DatetimeIndex` constructor directly: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you put the first |
||
'infer' can be passed in order to set the frequency of the index as the inferred frequency | ||
upon creation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a colon after creation, i.e. "...upon creation:" |
||
|
||
.. ipython:: python | ||
|
||
pd.DatetimeIndex(['2018-01-01', '2018-01-03', '2018-01-05']) | ||
|
||
pd.DatetimeIndex(['2018-01-01', '2018-01-03', '2018-01-05'], freq='infer') | ||
|
||
Providing a Format Argument | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,10 @@ class TimedeltaIndex(DatetimeIndexOpsMixin, TimelikeOps, Int64Index): | |
Optional timedelta-like data to construct index with | ||
unit: unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional | ||
which is an integer/float number | ||
freq: a frequency for the index, optional | ||
freq : string or pandas offset object, optional | ||
One of pandas date offset strings or corresponding objects. The string | ||
'infer' can be passed in order to set the frequency of the index as the | ||
inferred frequency upon creation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this line has one extra space at the beginning. The "i" in inferred should be aligned with the single quote on the line above. Not sure if this impacts how the output will be rendered though. |
||
copy : bool | ||
Make a copy of input ndarray | ||
start : starting value, timedelta-like, optional | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a colon after creation, i.e. "...upon creation:"