Skip to content

BUG: fixed index power operation #14996

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
wants to merge 3 commits into from
Closed

BUG: fixed index power operation #14996

wants to merge 3 commits into from

Conversation

kamal94
Copy link
Contributor

@kamal94 kamal94 commented Dec 27, 2016

* The power operation on a range of indexes was fixed. See issue #14973
@kamal94 kamal94 mentioned this pull request Dec 27, 2016
4 tasks
@@ -105,6 +105,21 @@ def test_numeric_compat(self):
for r, e in zip(result, expected):
tm.assert_index_equal(r, e)

#test power calculations both ways
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model this after the existing code, IOW, use idx which is already define.

add a comment with this issue number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your guidance. Changes implemented.

pow_range = 2.0**num_range
idxs = pd.Float64Index(range(1, 11))

expected_pow_values = pd.Float64Index(pow_range)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use expected and result

@@ -282,6 +282,7 @@ Performance Improvements
Bug Fixes
~~~~~~~~~

- Bug in ``Indexes`` Power numerical operations did not operate correctly (:issue:`14973`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug in Index power operations with with reversed operands

@jreback jreback added Bug Numeric Operations Arithmetic, Comparison, and Logical operations labels Dec 27, 2016
* Changed variable names to follow code standards
* Changed changelog to correct wording
* Added Github issue in comment to follow documentation standard
@codecov-io
Copy link

codecov-io commented Dec 27, 2016

Current coverage is 84.78% (diff: 100%)

Merging #14996 into master will increase coverage by <.01%

@@             master     #14996   diff @@
==========================================
  Files           145        145          
  Lines         51090      51091     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43315      43317     +2   
+ Misses         7775       7774     -1   
  Partials          0          0          

Powered by Codecov. Last update 7f0eefc...66c2338

@kamal94
Copy link
Contributor Author

kamal94 commented Dec 29, 2016

@jreback anything more I can do to have it accepted?

@jreback jreback added this to the 0.20.0 milestone Dec 30, 2016
@jreback jreback closed this in 298b241 Dec 30, 2016
@jreback
Copy link
Contributor

jreback commented Dec 30, 2016

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using the python power operator on numerical Index objects yields unexpected results
3 participants