@@ -190,6 +190,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
190
190
----------
191
191
arg : string, datetime, list, tuple, 1-d array, or Series
192
192
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
193
+
193
194
- If 'raise', then invalid parsing will raise an exception
194
195
- If 'coerce', then invalid parsing will be set as NaT
195
196
- If 'ignore', then invalid parsing will return the input
@@ -201,10 +202,12 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
201
202
with day first (this is a known bug, based on dateutil behavior).
202
203
yearfirst : boolean, default False
203
204
Specify a date parse order if `arg` is str or its list-likes.
205
+
204
206
- If True parses dates with the year first, eg 10/11/12 is parsed as
205
207
2010-11-12.
206
208
- If both dayfirst and yearfirst are True, yearfirst is preceded (same
207
209
as dateutil).
210
+
208
211
Warning: yearfirst=True is not strict, but will prefer to parse
209
212
with year first (this is a known bug, based on dateutil beahavior).
210
213
@@ -214,14 +217,17 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
214
217
Return UTC DatetimeIndex if True (converting any tz-aware
215
218
datetime.datetime objects as well).
216
219
box : boolean, default True
220
+
217
221
- If True returns a DatetimeIndex
218
222
- If False returns ndarray of values.
219
223
format : string, default None
220
224
strftime to parse time, eg "%d/%m/%Y", note that "%f" will parse
221
225
all the way up to nanoseconds.
222
226
exact : boolean, True by default
227
+
223
228
- If True, require an exact format match.
224
229
- If False, allow the format to match anywhere in the target string.
230
+
225
231
unit : unit of the arg (D,s,ms,us,ns) denote the unit in epoch
226
232
(e.g. a unix timestamp), which is an integer/float number.
227
233
infer_datetime_format : boolean, default False
@@ -273,6 +279,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
273
279
datetime.datetime(1300, 1, 1, 0, 0)
274
280
>>> pd.to_datetime('13000101', format='%Y%m%d', errors='coerce')
275
281
NaT
282
+
276
283
"""
277
284
return _to_datetime (arg , errors = errors , dayfirst = dayfirst ,
278
285
yearfirst = yearfirst ,
0 commit comments