8000 BUG: timezone comparisions are inconsistent, manifesting in bugs in .concat by jreback · Pull Request #19281 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: timezone comparisions are inconsistent, manifesting in bugs in .concat #19281

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

Merged
merged 4 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fi
  • Loading branch information
jreback committed Jan 18, 2018
commit 473bd87b711f6bfb254dd87278b75eb3d48c887e
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Reshaping
- Bug in :func:`Dataframe.pivot_table` which fails when the ``aggfunc`` arg is of type string. The behavior is now consistent with other methods like ``agg`` and ``apply`` (:issue:`18713`)
- Bug in :func:`DataFrame.merge` in which merging using ``Index`` objects as vectors raised an Exception (:issue:`19038`)
- Bug in :func:`DataFrame.stack`, :func:`DataFrame.unstack`, :func:`Series.unstack` which were not returning subclasses (:issue:`15563`)
- Bug in timezone comparisons, manifesting as a conversion of the index to UTC when ``.reset_index()`` (:issue:`18523`)
- Bug in timezone comparisons, manifesting as a conversion of the index to UTC in ``.concat()`` (:issue:`18523`)
-

Numeric
Expand Down
20 changes: 0 additions & 20 deletions pandas/tests/indexes/datetimes/test_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,26 +443,6 @@ def test_000constructor_resolution(self):

assert idx.nanosecond[0] == t1.nanosecond

def test_concat(self):
idx1 = pd.date_range('2011-01-01', periods=3, freq='H',
tz='Europe/Paris')
idx2 = pd.date_range(start=idx1[0], end=idx1[-1], freq='H')
df1 = pd.DataFrame({'a': [1, 2, 3]}, index=idx1)
df2 = pd.DataFrame({'b': [1, 2, 3]}, index=idx2)
res = pd.concat([df1, df2], axis=1)

assert str(res.index.tzinfo) == str(df1.index.tzinfo)
assert str(res.index.tzinfo) == str(df2.index.tzinfo)

idx3 = pd.date_range('2011-01-01', periods=3,
freq='H', tz='Asia/Tokyo')
df3 = pd.DataFrame({'b': [1, 2, 3]}, index=idx3)
res = pd.concat([df1, df3], axis=1)

assert str(res.index.tzinfo) == 'UTC'
assert str(res.index.tzinfo) != str(df1.index.tzinfo)
assert str(res.index.tzinfo) != str(df3.index.tzinfo)


class TestTimeSeries(object):

Expand Down
0