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

Error in Timezone handling of DataFrames when joined #2317

Closed
lterry-t opened this issue Nov 21, 2012 · 2 comments
Closed

Error in Timezone handling of DataFrames when joined #2317

lterry-t opened this issue Nov 21, 2012 · 2 comments
Assignees
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@lterry-t
Copy link

When joining two DataFrames with localized indexes, the resulting DataFrame has erroneous Timestamps. (It appears that at some point the timestamps are interpreted at UTC without a correct timezone correction?)

Sample code:

In [94]: test1 = pandas.DataFrame(numpy.zeros((6,3)),index=pandas.tseries.index.date_range("2012-11-15 00:00:00", periods=6, freq="100L", tz="US/Central"))

In [95]: test2 = pandas.DataFrame(numpy.zeros((3,3)),index=pandas.tseries.index.date_range("2012-11-15 00:00:00", periods=3, freq="250L", tz="US/Central"), columns=range(3,6))

In [96]: test1
Out[96]:
                                  0  1  2
2012-11-15 00:00:00-06:00         0  0  0
2012-11-15 00:00:00.100000-06:00  0  0  0
2012-11-15 00:00:00.200000-06:00  0  0  0
2012-11-15 00:00:00.300000-06:00  0  0  0
2012-11-15 00:00:00.400000-06:00  0  0  0
2012-11-15 00:00:00.500000-06:00  0  0  0

In [97]: test2
Out[97]:
                                  3  4  5
2012-11-15 00:00:00-06:00         0  0  0
2012-11-15 00:00:00.250000-06:00  0  0  0
2012-11-15 00:00:00.500000-06:00  0  0  0

In [98]: test1.join(test2, how="outer")
Out[98]:
                                   0   1   2   3   4   5
2012-11-15 06:00:00-06:00          0   0   0   0   0   0
2012-11-15 06:00:00.100000-06:00   0   0   0 NaN NaN NaN
2012-11-15 06:00:00.200000-06:00   0   0   0 NaN NaN NaN
2012-11-15 06:00:00.250000-06:00 NaN NaN NaN   0   0   0
2012-11-15 06:00:00.300000-06:00   0   0   0 NaN NaN NaN
2012-11-15 06:00:00.400000-06:00   0   0   0 NaN NaN NaN
2012-11-15 06:00:00.500000-06:00   0   0   0   0   0   0
@wesm
Copy link
Member

wesm commented Nov 23, 2012

Yeah looks like a bug. marked as such

@ghost ghost assigned wesm Nov 24, 2012
@wesm wesm closed this as completed in f29106d Nov 24, 2012
@lterry-t
Copy link
Author

Awesome. Thanks!

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

2 participants