Skip to content

DOC: specify return type in to_datetime #8921

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pandas/tseries/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def to_datetime(arg, errors='ignore', dayfirst=False, utc=None, box=True,
format=None, coerce=False, unit='ns',
infer_datetime_format=False):
"""
Convert argument to datetime
Convert argument to datetime.

Parameters
----------
Expand All @@ -198,13 +198,16 @@ def to_datetime(arg, errors='ignore', dayfirst=False, utc=None, box=True,
coerce : force errors to NaT (False by default)
unit : unit of the arg (D,s,ms,us,ns) denote the unit in epoch
(e.g. a unix timestamp), which is an integer/float number
infer_datetime_format: boolean, default False
infer_datetime_format : boolean, default False
If no `format` is given, try to infer the format based on the first
datetime string. Provides a large speed-up in many cases.

Returns
-------
ret : datetime if parsing succeeded
ret : datetime if parsing succeeded. Return type depends on input:
- list-like: DatetimeIndex
- Series: Series of datetime64 dtype
- scalar: Timestamp

Examples
--------
Expand Down