Skip to content

Commit 759d5a7

Browse files
committed
CLN: Worked on Code Reviews
1 parent 1fe275d commit 759d5a7

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

doc/source/whatsnew/v0.19.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Highlights include:
2121

2222
New features
2323
~~~~~~~~~~~~
24+
- ``pd.to_datetime`` has a new parameter, ``origin``, to define an offset for ``DatetimeIndex`` (:issue:`11276`, :issue:`11745`)
2425

2526
.. _whatsnew_0190.dev_api:
2627

doc/source/whatsnew/v0.20.0.txt

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Check the :ref:`API Changes <whatsnew_0200.api_breaking>` and :ref:`deprecations
2020

2121
New features
2222
~~~~~~~~~~~~
23-
- ``pd.to_datetime`` has a new parameter, ``origin``, to define an offset for ``DatetimeIndex`` (:issue:`11276`, :issue:`11745`)
2423

2524

2625

pandas/tseries/tools.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,14 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
242242
default 'epoch'.
243243
Define relative offset for the returned dates.
244244
245-
- If 'epoch', offset is set to 1-1-1970.
245+
- If 'epoch', offset is set to 1970-01-01.
246246
- If 'julian', unit must be 'D', and offset is set to beginning of
247-
Julian Calendar.
247+
Julian Calendar. Julian day number 0 is assigned to the day starting
248+
at noon on January 1, 4713 BC.
248249
- If Timestamp convertible, offset is set to Timestamp identified by
249250
origin.
250251
251-
.. versionadded: 0.20.0
252+
.. versionadded: 0.19.0
252253
253254
Returns
254255
-------
@@ -305,7 +306,9 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
305306
>>> %timeit pd.to_datetime(s,infer_datetime_format=False)
306307
1 loop, best of 3: 471 ms per loop
307308
308-
>>> pd.to_datetime(range(100), unit='D', origin=Timestamp('1960-01-01'))
309+
Using non-epoch origins to parse date
310+
311+
>>> pd.to_datetime([1,2,3], unit='D', origin=Timestamp('1960-01-01'))
309312
0 1960-01-01
310313
1 1960-01-02
311314
...

0 commit comments

Comments
 (0)