Skip to content

Commit 45bd84a

Browse files
committed
DOCS: update array_with_unit_to_datetime docstring
1 parent 021a735 commit 45bd84a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

pandas/_libs/tslib.pyx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,30 @@ def format_array_from_datetime(ndarray[int64_t] values, object tz=None,
299299
def array_with_unit_to_datetime(ndarray values, object unit,
300300
str errors='coerce', ndarray mask=None):
301301
"""
302-
convert the ndarray according to the unit
302+
Convert the ndarray to datetime according to the time unit.
303+
304+
This function converts an array of objects into a numpy array of
305+
datetime64[ns]. It returns the converted array
306+
and also returns the timezone offset
307+
303308
if errors:
304309
- raise: return converted values or raise OutOfBoundsDatetime
305310
if out of range on the conversion or
306311
ValueError for other conversions (e.g. a string)
307312
- ignore: return non-convertible values as the same unit
308313
- coerce: NaT for non-convertibles
309-
314+
315+
Parameters
316+
----------
317+
values : ndarray of object
318+
Date-like objects to convert
319+
unit : object
320+
Time unit to use during conversion
321+
mask : ndarray of bool, default None
322+
Not-a-time mask for non-nullable integer types conversion
323+
errors : str, default 'raise'
324+
Error behavior when parsing
325+
310326
Returns
311327
-------
312328
result : ndarray of m8 values

0 commit comments

Comments
 (0)