-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
PDEP0004: implementation #49024
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
PDEP0004: implementation #49024
Changes from all commits
ea79669
bb68cc3
82266f4
4a6f198
5568dca
bc910b0
7d03503
ac825f5
2ffcef6
060835d
1d9f274
b3e32ac
22417cf
d3adfe5
affa7f3
575b215
f0e83da
a5ff448
68a6ea2
6661ae3
1d255e0
b3aa585
285b1ff
963b62b
c90a8a5
3c033ff
cdfa355
434c6f0
5755032
96c0653
9f1c18e
0a86705
7b4d6be
86e9bcf
f92a8cb
fd215df
0a5c466
772dd6c
b49b7cf
17f5e74
d17d819
f4520e9
fcb515f
78b4b9e
2215652
1ec70db
7b0eb99
7d11f59
30e6f39
f0ac458
92ef7e2
4a5dd1c
917b31b
135bbb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,8 @@ time. | |
|
||
.. ipython:: python | ||
|
||
import datetime | ||
|
||
pd.Timestamp(datetime.datetime(2012, 5, 1)) | ||
pd.Timestamp("2012-05-01") | ||
pd.Timestamp(2012, 5, 1) | ||
|
@@ -196,26 +198,25 @@ is converted to a ``DatetimeIndex``: | |
|
||
.. ipython:: python | ||
|
||
pd.to_datetime(pd.Series(["Jul 31, 2009", "2010-01-10", None])) | ||
pd.to_datetime(pd.Series(["Jul 31, 2009", "Jan 10, 2010", None])) | ||
|
||
pd.to_datetime(["2005/11/23", "2010.12.31"]) | ||
pd.to_datetime(["2005/11/23", "2010/12/31"]) | ||
|
||
If you use dates which start with the day first (i.e. European style), | ||
you can pass the ``dayfirst`` flag: | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
:okwarning: | ||
|
||
pd.to_datetime(["04-01-2012 10:00"], dayfirst=True) | ||
|
||
pd.to_datetime(["14-01-2012", "01-14-2012"], dayfirst=True) | ||
pd.to_datetime(["04-14-2012 10:00"], dayfirst=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this line still necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jbrockmendel thanks for your review - any other objections? Sorry to tag, just hoping to move this forwards before more merge conflicts arise There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all good here. ill take another look tomorrowish if this is still up, but if it is merged before then i wont complain |
||
|
||
.. warning:: | ||
|
||
You see in the above example that ``dayfirst`` isn't strict. If a date | ||
can't be parsed with the day being first it will be parsed as if | ||
``dayfirst`` were False, and in the case of parsing delimited date strings | ||
(e.g. ``31-12-2012``) then a warning will also be raised. | ||
``dayfirst`` were ``False`` and a warning will also be raised. | ||
|
||
If you pass a single string to ``to_datetime``, it returns a single ``Timestamp``. | ||
``Timestamp`` can also accept string input, but it doesn't accept string parsing | ||
|
Uh oh!
There was an error while loading. Please reload this page.