Skip to content

Commit 5ed8ef5

Browse files
edut docstring to fit Python Standards
1 parent 7402de4 commit 5ed8ef5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

pandas/tseries/tools.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ def _lexer_split_from_str(dt_str):
3030
# The StringIO(str(_)) is for dateutil 2.2 compatibility
3131
return _timelex.split(compat.StringIO(str(dt_str)))
3232

33-
3433
_DATEUTIL_LEXER_SPLIT = _lexer_split_from_str
3534
except (ImportError, AttributeError):
3635
pass
3736

38-
3937
def _infer_tzinfo(start, end):
4038
def _infer(a, b):
4139
tz = a.tzinfo
@@ -52,7 +50,6 @@ def _infer(a, b):
5250
tz = _infer(end, start)
5351
return tz
5452

55-
5653
def _guess_datetime_format(dt_str, dayfirst=False,
5754
dt_str_parse=compat.parse_date,
5855
dt_str_split=_DATEUTIL_LEXER_SPLIT):
@@ -269,11 +266,13 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
269266
1 2016-03-05
270267
dtype: datetime64[ns]
271268
272-
Since pandas represents timestamps in nanosecond resolution, the timespan that can be represented using a 64-bit
273-
integer is limited to approximately 584 years.
274-
If a date that does not meet timestamp limitations, passing errors='ignore' will simply return the original input
275-
instead of raising any exception.
276-
Passing errors='coerce' will force to NaT. Furthermore this will force non-dates to NaT as well.
269+
Since pandas represents timestamps in nanosecond resolution, the timespan
270+
that can be represented using a 64-bit integer is limited to approximately
271+
584 years.
272+
If a date that does not meet timestamp limitations, passing errors='ignore'
273+
will simply return the original input instead of raising any exception.
274+
Passing errors='coerce' will force to NaT. Furthermore this will force
275+
non-dates to NaT as well.
277276
278277
>>> pd.to_datetime('13000101', format='%Y%m%d', errors='ignore')
279278
datetime.datetime(1300, 1, 1, 0, 0)

0 commit comments

Comments
 (0)