We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Worked in prior versions...
import pandas as pd raw_data = {'regiment': ['Nighthawks', 'Nighthawks', 'Nighthawks', 'Nighthawks', 'Dragoons', 'Dragoons', 'Dragoons', 'Dragoons', 'Scouts', 'Scouts', 'Scouts', 'Scouts'], 'company': ['infantry', 'infantry', 'cavalry', 'cavalry', 'infantry', 'infantry', 'cavalry', 'cavalry','infantry', 'infantry', 'cavalry', 'cavalry'], 'experience': ['veteran', 'rookie', 'veteran', 'rookie', 'veteran', 'rookie', 'veteran', 'rookie','veteran', 'rookie', 'veteran', 'rookie'], 'name': ['Miller', 'Jacobson', 'Ali', 'Milner', 'Cooze', 'Jacon', 'Ryaner', 'Sone', 'Sloan', 'Piger', 'Riani', 'Ali'], 'preTestScore': [4, 24, 31, 2, 3, 4, 24, 31, 2, 3, 2, 3], 'postTestScore': [25, 94, 57, 62, 70, 25, 94, 57, 62, 70, 62, 70]} df = pd.DataFrame(raw_data, columns = ['regiment', 'company', 'experience', 'name', 'preTestScore', 'postTestScore'])
import numpy as np np.round(df.regiment,1)
a number
ERROR !!!! not a numpy bug..
TypeError Traceback (most recent call last) in () 1 2 import numpy as np ----> 3 np.round(df.regiment,1)
/Library/Python/2.7/site-packages/numpy/core/fromnumeric.pyc in round_(a, decimals, out) 2791 except AttributeError: 2792 return _wrapit(a, 'round', decimals, out) -> 2793 return round(decimals, out) 2794 2795
TypeError: round() takes at most 2 arguments (3 given)
pd.show_versions()
commit: None python: 2.7.5.final.0 python-bits: 64 OS: Darwin OS-release: 13.4.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8
pandas: 0.18.0 nose: None pip: 8.1.1 setuptools: 20.9.0 Cython: None numpy: 1.11.0 scipy: 0.17.0 statsmodels: None xarray: None IPython: 4.2.0 sphinx: None patsy: None dateutil: 2.5.3 pytz: 2016.4 blosc: None bottleneck: None tables: None numexpr: None matplotlib: 1.5.1 openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None httplib2: None apiclient: None sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.8 boto: None
The text was updated successfully, but these errors were encountered:
dupe of #12600 already fixed in #12603
Sorry, something went wrong.
you should just use .round() in any event
.round()
No branches or pull requests
Code Sample, a copy-pastable example if possible
Worked in prior versions...
Expected Output
a number
ERROR !!!! not a numpy bug..
TypeError Traceback (most recent call last)
in ()
1
2 import numpy as np
----> 3 np.round(df.regiment,1)
/Library/Python/2.7/site-packages/numpy/core/fromnumeric.pyc in round_(a, decimals, out)
2791 except AttributeError:
2792 return _wrapit(a, 'round', decimals, out)
-> 2793 return round(decimals, out)
2794
2795
TypeError: round() takes at most 2 arguments (3 given)
output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.5.final.0
python-bits: 64
OS: Darwin
OS-release: 13.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 20.9.0
Cython: None
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
The text was updated successfully, but these errors were encountered: