-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Multicolumn GroupBy appears to convert unit64s to floats #30859
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
Labels
Milestone
Comments
Can you try on master? Looks OK for me: >>> pd.DataFrame({'first': [1], 'second': [1], 'value': [16148277970000000000]}).groupby(['first', 'second'])['value'].max()
first second
1 1 16148277970000000000
Name: value, dtype: uint64 |
If you can reproduce the problem at 0.25.3 but not at master, I think we can call this closed as already fixed. If not, I'm going to need your help on how to build the master version as I've not done it before. |
Works in 1.1.1 |
A PR that creates a test case would be welcomed. |
take |
TAJD
pushed a commit
to TAJD/pandas
that referenced
this issue
Sep 6, 2020
4 tasks
jreback
pushed a commit
that referenced
this issue
Sep 7, 2020
jbrockmendel
pushed a commit
to jbrockmendel/pandas
that referenced
this issue
Sep 8, 2020
kesmit13
pushed a commit
to kesmit13/pandas
that referenced
this issue
Nov 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
Problem description
When that code snippet runs, the result is not
16148277970000000000
as you would expect, but16148277969999998976
. Note thatint(float(16148277970000000000)) == 16148277969999998976
.Additional notes:
groupby(['first'])
returns the expected result. So does removing thegroupby
statement entirely.max
. I get the same problem formin
,first
,last
,median
,mean
, but nothead
,tail
, orapply
..transform(max)
.Expected Output
16148277970000000000
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.14.137+
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.25.3
numpy : 1.17.5
pytz : 2018.9
dateutil : 2.6.1
pip : 19.3.1
setuptools : 42.0.2
Cython : 0.29.14
pytest : 3.6.4
hypothesis : None
sphinx : 1.8.5
blosc : None
feather : 0.4.0
xlsxwriter : None
lxml.etree : 4.2.6
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2 : 2.10.3
IPython : 5.5.0
pandas_datareader: 0.7.4
bs4 : 4.6.3
bottleneck : 1.3.1
fastparquet : None
gcsfs : 0.6.0
lxml.etree : 4.2.6
matplotlib : 3.1.2
numexpr : 2.7.1
odfpy : None
openpyxl : 2.5.9
pandas_gbq : 0.11.0
pyarrow : 0.14.1
pytables : None
s3fs : 0.4.0
scipy : 1.4.1
sqlalchemy : 1.3.12
tables : 3.4.4
xarray : 0.14.1
xlrd : 1.1.0
xlwt : 1.3.0
xlsxwriter : None
The text was updated successfully, but these errors were encountered: