Skip to content

pandas index does not give expected behaviour when raised to a power #15565

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
lingxz opened this issue Mar 4, 2017 · 1 comment
Closed

pandas index does not give expected behaviour when raised to a power #15565

lingxz opened this issue Mar 4, 2017 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@lingxz
Copy link

lingxz commented Mar 4, 2017

Code Sample, a copy-pastable example if possible

>>> import pandas as pd
>>> test = list(range(5))
>>> a = pd.Series(test, index=test)
>>> a.index
Int64Index([0, 1, 2, 3, 4], dtype='int64')
>>> 0.5**a.index
Float64Index([0.0, 1.0, 1.41421356237, 1.73205080757, 2.0], dtype='float64')

Problem description

The index doesn't seem to behave properly when it is being raised to the power. It is not giving the correct values. It seems to work well with other operations like multiplication.

Expected Output

Float64Index(array([ 1.    ,  0.5   ,  0.25  ,  0.125 ,  0.0625]), dtype='float64')

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.5.2.final.0 python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None

pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 27.2.0
Cython: None
numpy: 1.11.3
scipy: 0.18.1
statsmodels: None
xarray: 0.9.1
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.3
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.4
boto: None
pandas_datareader: None

@jreback jreback added Bug Duplicate Report Duplicate issue or pull request Numeric Operations Arithmetic, Comparison, and Logical operations labels Mar 4, 2017
@jreback jreback added this to the 0.20.0 milestone Mar 4, 2017
@jreback
Copy link
Contributor

jreback commented Mar 4, 2017

duplicate of #14973 which is fixed 298b241

@jreback jreback closed this as completed Mar 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

2 participants