Skip to content

DataFrame.diff fails with nullable integers #30967

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
MarcoGorelli opened this issue Jan 13, 2020 · 1 comment · Fixed by #31025
Closed

DataFrame.diff fails with nullable integers #30967

MarcoGorelli opened this issue Jan 13, 2020 · 1 comment · Fixed by #31025

Comments

@MarcoGorelli
Copy link
Member

Related to #30889 (I've opened a separate issue as the error is different)

Code Sample, a copy-pastable example if possible

df = pd.DataFrame({"a": [1, 2, 3]}, dtype="Int16")
df.diff()

Problem description

This returns

IndexError: list assignment index out of range

Expected Output

Something like

     a
0  pd.NA
1  1
2  1

Output of pd.show_versions()

INSTALLED VERSIONS

commit : 46c2864
python : 3.7.3.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-74-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8

pandas : 0.25.0+1754.g46c2864c3
numpy : 1.17.3
pytz : 2019.3
dateutil : 2.8.0
pip : 19.3.1
setuptools : 42.0.2.post20191201
Cython : 0.29.14
pytest : 5.3.2
hypothesis : 4.55.4
sphinx : 2.3.0
blosc : None
feather : None
xlsxwriter : 1.2.6
lxml.etree : 4.4.2
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10.3
IPython : 7.9.0
pandas_datareader: None
bs4 : 4.8.1
bottleneck : 1.3.1
fastparquet : 0.3.2
gcsfs : None
lxml.etree : 4.4.2
matplotlib : 3.1.2
numexpr : 2.7.0
odfpy : None
openpyxl : 3.0.1
pandas_gbq : None
pyarrow : 0.15.1
pytables : None
pytest : 5.3.2
s3fs : 0.4.0
scipy : 1.4.0
sqlalchemy : 1.3.11
tables : 3.6.1
tabulate : 0.8.6
xarray : 0.14.1
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.6
numba : 0.46.0

@MarcoGorelli
Copy link
Member Author

Given that "ExtensionArrays are limited to 1-D.", I presume this is a "won't fix"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant