Skip to content

Commit

Permalink
Fix Timestamp __ne__ comparison issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and jreback committed Sep 9, 2015
1 parent 278b06c commit ccaf040
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
5 changes: 2 additions & 3 deletions doc/source/whatsnew/v0.17.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ See the :ref:`documentation <io.excel>` for more details.

df = pd.read_excel('test.xlsx', header=[0,1], index_col=[0,1])
df

.. ipython:: python
:suppress:

Expand Down Expand Up @@ -494,7 +494,7 @@ Datetime with TZ

We are adding an implementation that natively supports datetime with timezones. A ``Series`` or a ``DataFrame`` column previously
*could* be assigned a datetime with timezones, and would work as an ``object`` dtype. This had performance issues with a large
number rows. See the :ref:`docs <timeseries.timezone_series>` for more details. (:issue:`8260`, :issue:`10763`).
number rows. See the :ref:`docs <timeseries.timezone_series>` for more details. (:issue:`8260`, :issue:`10763`, :issue:`11034`).

The new implementation allows for having a single-timezone across all rows, with operations in a performant manner.

Expand Down Expand Up @@ -966,7 +966,6 @@ Bug Fixes
- Bug in ``Series.count`` when index has nulls (:issue:`10946`)
- Bug in pickling of a non-regular freq ``DatetimeIndex`` (:issue:`11002`)
- Bug causing ``DataFrame.where`` to not respect the ``axis`` parameter when the frame has a symmetric shape. (:issue:`9736`)

- Bug in ``Table.select_column`` where name is not preserved (:issue:`10392`)
- Bug in ``offsets.generate_range`` where ``start`` and ``end`` have finer precision than ``offset`` (:issue:`9907`)
- Bug in ``pd.rolling_*`` where ``Series.name`` would be lost in the output (:issue:`10565`)
Expand Down
5 changes: 1 addition & 4 deletions pandas/core/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,7 @@ def na_op(x, y):
else:
y = y.view('i8')

if name == '__ne__':
mask = notnull(x)
else:
mask = isnull(x)
mask = isnull(x)

x = x.view('i8')

Expand Down
21 changes: 20 additions & 1 deletion pandas/tseries/tests/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@ def test_period_resample_with_local_timezone_dateutil(self):
expected = pd.Series(1, index=expected_index)
assert_series_equal(result, expected)


def test_pickle(self):

# GH4606
Expand All @@ -2171,6 +2170,26 @@ def test_pickle(self):
idx_p = self.round_trip_pickle(idx)
tm.assert_index_equal(idx, idx_p)

def test_timestamp_equality(self):

# GH 11034
s = Series([Timestamp('2000-01-29 01:59:00'),'NaT'])
result = s != s
assert_series_equal(result, Series([False,True]))
result = s != s[0]
assert_series_equal(result, Series([False,True]))
result = s != s[1]
assert_series_equal(result, Series([True,True]))

result = s == s
assert_series_equal(result, Series([True,False]))
result = s == s[0]
assert_series_equal(result, Series([True,False]))
result = s == s[1]
assert_series_equal(result, Series([False,False]))



def _simple_ts(start, end, freq='D'):
rng = date_range(start, end, freq=freq)
return Series(np.random.randn(len(rng)), index=rng)
Expand Down

0 comments on commit ccaf040

Please sign in to comment.