-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
to_datetime parsing bug when using format #4152
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
Comments
FYI, the reason why I want to use |
@hayd I don't think so, #3669 was about that the "format" argument was ignored completely. This is about that there seems to be a bug in the parser used when format is given. As an example, it doesn't matter if you give a single string or an array, both give a wrong result: In [12]: pd.to_datetime('01-Apr-2011 00:00:01.978', format= '%d-%b-%Y %H:%M:%S.%f')
Out[12]: Timestamp('2011-03-31 23:24:13.516352', tz=None)
In [14]: pd.to_datetime(np.array(['01-Apr-2011 00:00:01.978']), format= '%d-%b-%Y %H:%M:%S.%f')
Out[14]:
<class 'pandas.tseries.index.DatetimeIndex'>
[2011-03-31 23:24:13.516352]
Length: 1, Freq: None, Timezone: None And it seems that it has something to do with the parsing of the microseconds: In [17]: pd.to_datetime('01-Apr-2011 00:00:01.000', format= '%d-%b-%Y %H:%M:%S.
Out[17]: Timestamp('2011-04-01 00:00:01', tz=None)
In [18]: pd.to_datetime('01-Apr-2011 00:00:01.001', format= '%d-%b-%Y %H:%M:%S.
Out[18]: Timestamp('2011-04-01 00:16:41', tz=None) |
BUG: wrong parsing of microseconds with format arg (#4152)
* commit 'v0.12.0rc1-43-g7b2eaa4': (571 commits) PERF: add ix scalar get benchmark DOC: more prominent HDFStore store docs about storer/table formats BUG: invert_xaxis (negative tot_sec) triggers MilliSecondLocator (pandas-dev#3990) BUG: (GH4192) fixed broken unit test BUG: (GH4192) Fixed buglet in the broadcasting logic in Series.where CLN: Ignore warnings generated by 'DROP TABLE IF EXISTS' when table does not exist. DOC: more cookbook recipies DOC: update ipython_directive with changes from ipython to restart prompt number at 1 each page DOC: increased width of text area TST: fix ujson tests failures on 32-bit TST: raise when no data are found when trying to dld multiple symbols TST: Create a MySQL database and run MySQL tests on Travis. CLN: write the attributes in a HDFStore as strings TST: remove double call to yahoo finance DOC to_datetime warning about dayfirst strictness TST: to_datetime format fixes DOC: minor io/whatsnew doc edits BUG/TST: wrong parsing of microseconds with format arg (pandas-dev#4152) RLS: first release candidate for v0.12.0 BLD: use the wheel url for scikits timeseries ...
The text was updated successfully, but these errors were encountered: