-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. model this after the existing code, IOW, use add a comment with this issue number. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your guidance. Changes implemented. |
||
num_range = np.arange(1,11) | ||
pow_range = 2.0**num_range | ||
idxs = pd.Float64Index(range(1, 11)) | ||
|
||
expected_pow_values = pd.Float64Index(pow_range) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
actual_pow_values = 2.0**idxs | ||
tm.assert_index_equal(expected_pow_values, actual_pow_values) | ||
|
||
pow_range_rev = num_range**2.0 | ||
expected_rev_pow_values = pd.Float64Index(pow_range_rev) | ||
actual_rev_pow_values = idxs**2.0 | ||
tm.assert_index_equal(expected_rev_pow_values, actual_rev_pow_values) | ||
|
||
|
||
def test_explicit_conversions(self): | ||
|
||
# GH 8608 | ||
|
There was a problem hiding this comment.
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