Skip to content

Commit 14c47a8

Browse files
committed
DOC: updated wording of a previous fix
* Changed variable names to follow code standards * Changed changelog to correct wording * Added Github issue in comment to follow documentation standard
1 parent a6c9458 commit 14c47a8

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

doc/source/whatsnew/v0.20.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Performance Improvements
282282
Bug Fixes
283283
~~~~~~~~~
284284

285-
- Bug in ``Indexes`` Power numerical operations did not operate correctly (:issue:`14973`)
285+
- Bug in ``Index`` power operations with reversed operands(:issue:`14973`)
286286
- Bug in ``TimedeltaIndex`` addition where overflow was being allowed without error (:issue:`14816`)
287287
- Bug in ``DataFrame`` construction in which unsigned 64-bit integer elements were being converted to objects (:issue:`14881`)
288288
- Bug in ``astype()`` where ``inf`` values were incorrectly converted to integers. Now raises error now with ``astype()`` for Series and DataFrames (:issue:`14265`)

pandas/tests/indexes/test_numeric.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,15 @@ def test_numeric_compat(self):
105105
for r, e in zip(result, expected):
106106
tm.assert_index_equal(r, e)
107107

108-
#test power calculations both ways
109-
num_range = np.arange(1,11)
110-
pow_range = 2.0**num_range
111-
idxs = pd.Float64Index(range(1, 11))
112-
113-
expected_pow_values = pd.Float64Index(pow_range)
114-
actual_pow_values = 2.0**idxs
115-
tm.assert_index_equal(expected_pow_values, actual_pow_values)
108+
# test power calculations both ways, GH 14973
109+
expected = pd.Float64Index(2.0**idx.values)
110+
result = 2.0**idx
111+
tm.assert_index_equal(result, expected)
116112

117-
pow_range_rev = num_range**2.0
118-
expected_rev_pow_values = pd.Float64Index(pow_range_rev)
119-
actual_rev_pow_values = idxs**2.0
120-
tm.assert_index_equal(expected_rev_pow_values, actual_rev_pow_values)
113+
expected = pd.Float64Index(idx.values**2.0)
114+
result = idx**2.0
115+
tm.assert_index_equal(result, expected)
121116

122-
123117
def test_explicit_conversions(self):
124118

125119
# GH 8608

0 commit comments

Comments
 (0)