Skip to content
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

pandas.to_datetime called on existing datetime64 Series results in bad data #2699

Closed
wesm opened this issue Jan 15, 2013 · 0 comments
Closed
Assignees
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@wesm
Copy link
Member

wesm commented Jan 15, 2013


In [7]: df.date
Out[7]: 
0    2007-10-29 00:00:00
1    2007-10-30 00:00:00
2    2007-10-31 00:00:00
3    2007-11-01 00:00:00
4    2007-11-02 00:00:00
5    2007-11-05 00:00:00
6    2007-11-06 00:00:00
7    2007-11-07 00:00:00
8    2007-11-08 00:00:00
9    2007-11-09 00:00:00
10   2007-11-12 00:00:00
11   2007-11-13 00:00:00
12   2007-11-14 00:00:00
13   2007-11-15 00:00:00
14   2007-11-16 00:00:00
...
985   2011-09-26 00:00:00
986   2011-09-27 00:00:00
987   2011-09-28 00:00:00
988   2011-09-29 00:00:00
989   2011-09-30 00:00:00
990   2011-10-03 00:00:00
991   2011-10-04 00:00:00
992   2011-10-05 00:00:00
993   2011-10-06 00:00:00
994   2011-10-07 00:00:00
995   2011-10-10 00:00:00
996   2011-10-11 00:00:00
997   2011-10-12 00:00:00
998   2011-10-13 00:00:00
999   2011-10-14 00:00:00
Name: date, Length: 1000

In [8]: pd.to_datetime(df.date)
Out[8]: 
0    1970-01-18 08:00:00
1    1970-01-19 08:00:00
2    1970-01-20 08:00:00
3    1970-01-21 08:00:00
4    1970-01-22 08:00:00
5    1970-01-14 16:00:00
6    1970-01-15 16:00:00
7    1970-01-16 16:00:00
8    1970-01-17 16:00:00
9    1970-01-18 16:00:00
10   1970-01-21 16:00:00
11   1970-01-22 16:00:00
12   1970-01-23 16:00:00
13   1970-01-14 00:00:00
14   1970-01-15 00:00:00
...
985   1970-01-24 08:00:00
986   1970-01-25 08:00:00
987   1970-01-26 08:00:00
988   1970-01-16 16:00:00
989   1970-01-17 16:00:00
990   1970-01-20 16:00:00
991   1970-01-21 16:00:00
992   1970-01-22 16:00:00
993   1970-01-23 16:00:00
994   1970-01-24 16:00:00
995   1970-01-17 00:00:00
996   1970-01-18 00:00:00
997   1970-01-19 00:00:00
998   1970-01-20 00:00:00
999   1970-01-21 00:00:00
Name: date, Length: 1000
@ghost ghost assigned wesm Jan 19, 2013
@wesm wesm closed this as completed in 03bee8d Jan 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

No branches or pull requests

1 participant