Skip to content
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

BUG: pandas.Series.round not yet implemented for FloatingArray #38844

Closed
1 task
klanderson opened this issue Dec 31, 2020 · 4 comments · Fixed by #39751
Closed
1 task

BUG: pandas.Series.round not yet implemented for FloatingArray #38844

klanderson opened this issue Dec 31, 2020 · 4 comments · Fixed by #39751
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@klanderson
Copy link

  • [X ] I have checked that this issue has not already been reported.

  • [ X] I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

import pandas as pd
df = pd.DataFrame([{'a':1.2},{'a':2.5}])
df = df.convert_dtypes()
df['a'] = df['a'].round()

Problem description

Getting an error when applying round to a Series with new FloatingArray.

import pandas as pd
df = pd.DataFrame([{'a':1.2},{'a':2.5}])
df = df.convert_dtypes()
df['a'] = df['a'].round()

The error message is:

File ".../lib/python3.8/site-packages/pandas/core/series.py", line 2183, in round
    result = self._values.round(decimals)
AttributeError: 'FloatingArray' object has no attribute 'round'

Expected Output

rounded floats

Output of pd.show_versions()

INSTALLED VERSIONS

commit : 3e89b4c
python : 3.8.5.final.0
python-bits : 64
OS : Darwin
OS-release : 20.2.0
Version : Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.2.0
numpy : 1.19.4
pytz : 2020.4
dateutil : 2.8.1
pip : 20.3
setuptools : 50.3.2.post20201201
Cython : None
pytest : 6.1.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.19.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : 0.8.4
fastparquet : None
gcsfs : 0.7.1
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 1.3.20
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None

@klanderson klanderson added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 31, 2020
@jreback
Copy link
Contributor

jreback commented Dec 31, 2020

PRs are welcome to implement as these are new arrays

@rhshadrach rhshadrach added ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 31, 2020
@rhshadrach rhshadrach added this to the Contributions Welcome milestone Dec 31, 2020
@simonjayhawkins simonjayhawkins changed the title BUG: pandas.Series.round with FloatingArray in version 1.2.0 BUG: pandas.Series.round not yet implemented for FloatingArray Jan 1, 2021
@jreback jreback modified the milestones: Contributions Welcome, 1.3 Jan 3, 2021
@codebraker
Copy link

I am currently having Pandas 1.2.4. Is this fix included here?

@jreback
Copy link
Contributor

jreback commented May 21, 2021

1.3

@yishairasowsky
Copy link

@jreback @klanderson @codebraker @rhshadrach @jd
so what was the answer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
5 participants