Skip to content

Commit 93e2118

Browse files
committed
reflect review
1 parent 890d7a4 commit 93e2118

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ Interval
648648
Indexing
649649
^^^^^^^^
650650

651+
- Bug in :meth:`DataFrame.ne` fails if columns contain column name "dtype" (:issue:`22383`)
651652
- The traceback from a ``KeyError`` when asking ``.loc`` for a single missing label is now shorter and more clear (:issue:`21557`)
652653
- When ``.ix`` is asked for a missing integer label in a :class:`MultiIndex` with a first level of integer type, it now raises a ``KeyError``, consistently with the case of a flat :class:`Int64Index, rather than falling back to positional indexing (:issue:`21593`)
653654
- Bug in :meth:`DatetimeIndex.reindex` when reindexing a tz-naive and tz-aware :class:`DatetimeIndex` (:issue:`8306`)
@@ -656,8 +657,7 @@ Indexing
656657
- Fixed ``DataFrame[np.nan]`` when columns are non-unique (:issue:`21428`)
657658
- Bug when indexing :class:`DatetimeIndex` with nanosecond resolution dates and timezones (:issue:`11679`)
658659
- Bug where indexing with a Numpy array containing negative values would mutate the indexer (:issue:`21867`)
659-
- Bug Dataframe.ne fails if columns containing column name 'dtype'
660-
660+
-
661661

662662
Missing
663663
^^^^^^^

pandas/core/computation/expressions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ def _has_bool_dtype(x):
161161
try:
162162
if not isinstance(x.dtype, np.dtype):
163163
x = x.rename({'dtype': 'temporary_dtype'}, axis=1)
164-
return x.dtype == bool
165-
else:
166-
return x.dtype == bool
164+
return x.dtype == bool
167165
except AttributeError:
168166
try:
169167
return 'bool' in x.dtypes

pandas/tests/test_expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def test_bool_ops_warn_on_arithmetic(self):
444444
tm.assert_frame_equal(r, e)
445445

446446
def test_bool_ops_column_name_dtype(self):
447-
# GH 22383 - .ne fails if columns containing column name 'dtype'
447+
# GH 22383 - .ne fails if columns containing column name 'dtype'
448448
df_has_error = DataFrame([[0, 1, 2, 'aa'], [0, 1, 2, 'aa'],
449449
[0, 1, 5, 'bb'], [0, 1, 5, 'bb'],
450450
[0, 1, 5, 'bb'], ['cc', 4, 4, 4]],

0 commit comments

Comments
 (0)