-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
round method throws error if DataFrame includes Int64Dtype #31478
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
Comments
Do you know if However, we have In [23]: np.round(s.array)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
AttributeError: 'int' object has no attribute 'rint'
The above exception was the direct cause of the following exception:
TypeError Traceback (most recent call last)
<ipython-input-23-841bf54cafae> in <module>
----> 1 np.round(s.array)
<__array_function__ internals> in round_(*args, **kwargs)
~/Envs/pandas-dev/lib/python3.7/site-packages/numpy/core/fromnumeric.py in round_(a, decimals, out)
3599 around : equivalent function; see for details.
3600 """
-> 3601 return around(a, decimals=decimals, out=out)
3602
3603
<__array_function__ internals> in around(*args, **kwargs)
~/Envs/pandas-dev/lib/python3.7/site-packages/numpy/core/fromnumeric.py in around(a, decimals, out)
3224
3225 """
-> 3226 return _wrapfunc(a, 'round', decimals=decimals, out=out)
3227
3228
~/Envs/pandas-dev/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
53 bound = getattr(obj, method, None)
54 if bound is None:
---> 55 return _wrapit(obj, method, *args, **kwds)
56
57 try:
~/Envs/pandas-dev/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapit(obj, method, *args, **kwds)
42 except AttributeError:
43 wrap = None
---> 44 result = getattr(asarray(obj), method)(*args, **kwds)
45 if wrap:
46 if not isinstance(result, mu.ndarray):
TypeError: loop of ufunc does not support argument 0 of type int which has no callable rint method numpy/numpy#13877 looks somewhat relevant... |
Looks like it isnt.
|
@MarcoGorelli this is also failing on 0.25.3, so I don't think it's appropriate to target for 1.0.1 I think our choices here are to either
|
Sorry, I have no recollection of having modified the milestone, I must have clicked by accident, will be careful to not do this again |
Fixed with tests in #38844 |
Code Sample, a copy-pastable example if possible
Problem description
round method throws above error.
Expected behavior is same to int64 dtype and ignore NaN.
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.8.1.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.13-arch1-1
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.0
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 45.1.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None
The text was updated successfully, but these errors were encountered: