Skip to content

DatetimeIndex.intersection should preserve timezone #4690

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

Closed
sboehler opened this issue Aug 27, 2013 · 0 comments · Fixed by #7458
Closed

DatetimeIndex.intersection should preserve timezone #4690

sboehler opened this issue Aug 27, 2013 · 0 comments · Fixed by #7458
Labels
Bug Frequency DateOffsets Timezones Timezone data dtype
Milestone

Comments

@sboehler
Copy link

pandas' intersection method on DatetimeIndex should preserve the timezone. I had some cases where it works, and some where it doesn't. Example that does not work:

In [75]: a = pd.date_range('2012-01-01', '2012-01-20', freq='D', tz='CET')

In [76]: b = pd.date_range('2012-01-01', '2012-01-19', freq='D', tz='CET')

In [77]: a.intersection(b)
Out[77]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2011-12-31 23:00:00, ..., 2012-01-18 23:00:00]
Length: 19, Freq: D, Timezone: None

In [78]: pd.__version__
Out[78]: '0.12.0'

I would expect Timezone: CET in the output of line [77], and the times to be correctly displayed in CET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants