Skip to content

groupby ignores rows containing the number -9223372036854775808 #15721

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
ReSqAr opened this issue Mar 17, 2017 · 2 comments
Closed

groupby ignores rows containing the number -9223372036854775808 #15721

ReSqAr opened this issue Mar 17, 2017 · 2 comments
Labels
Bug Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Milestone

Comments

@ReSqAr
Copy link

ReSqAr commented Mar 17, 2017

Code Sample, a copy-pastable example if possible

In [1]: import pandas as pd
In [2]: import numpy as np
In [3]: np.iinfo(np.int64).min == -9223372036854775808
True
In [4]: data = []
In [5]: data.append(-9223372036854775808)
In [6]: data.append(-9223372036854775808+1)
In [7]: data.append(0)
In [8]: df = pd.DataFrame( data, columns=["x"] ); df
Out[8]: 
                     x
0 -9223372036854775808
1 -9223372036854775807
2                    0
In [9]: df.groupby("x").groups
Out[9]: 
{-9223372036854775807: Int64Index([1], dtype='int64'),
 0: Int64Index([2], dtype='int64')}
In [10]: df.groupby("x")["x"].count()
x
-9223372036854775807    1
 0                      1
Name: x, dtype: int64

Problem description

The groupby operation ignores the row containing -9223372036854775808.

Output of pd.show_versions()

INSTALLED VERSIONS


commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.8.0-41-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8

pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 34.3.1
Cython: None
numpy: 1.11.1rc1
scipy: None
statsmodels: None
xarray: None
IPython: 5.3.0
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2014.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.5.1
html5lib: 0.999999999
httplib2: 0.9.1
apiclient: None
sqlalchemy: 1.0.14
pymysql: None
psycopg2: None
jinja2: 2.9.5
boto: None
pandas_datareader: None

@chris-b1
Copy link
Contributor

This works correctly on master - possibly fixed by #15205

In [7]: pd.__version__
Out[7]: '0.19.0+608.g54c6e93'

In [8]: df.groupby('x')['x'].count()

x
-9223372036854775808    1
-9223372036854775807    1
 0                      1
Name: x, dtype: int64

@jreback
Copy link
Contributor

jreback commented Mar 17, 2017

yep was just going to post that. thanks @chris-b1

@jreback jreback closed this as completed Mar 17, 2017
@jreback jreback added Bug Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Mar 17, 2017
@jreback jreback added this to the 0.20.0 milestone Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

No branches or pull requests

3 participants