We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
# pandas==0.24.2 df = pd.DataFrame(data={ 'A': ['a1','a2',None], 'B': ['b1','b2','b1'], 'val': [1,2,3], }) print(df) print('\n') grps = df.groupby(['A', 'B']) print(grps.get_group(('a2','b1')))
Selecting a group which doesn't appear, I obtain a group which should not exist.
KeyError
pd.show_versions()
commit: None python: 3.7.3.final.0 python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 62 Stepping 4, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None
pandas: 0.24.2 pytest: None pip: 19.0.3 setuptools: 40.8.0 Cython: None numpy: 1.16.2 scipy: 1.2.1 pyarrow: None xarray: None IPython: 7.4.0 sphinx: 2.0.1 patsy: 0.5.1 dateutil: 2.8.0 pytz: 2018.9 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: 3.0.3 openpyxl: None xlrd: 1.2.0 xlwt: None xlsxwriter: 1.1.7 lxml.etree: 4.3.3 bs4: None html5lib: 1.0.1 sqlalchemy: 1.3.8 pymysql: 0.9.3 psycopg2: 2.8.3 (dt dec pq3 ext lo64) jinja2: 2.10 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None gcsfs: None
The text was updated successfully, but these errors were encountered:
take
Sorry, something went wrong.
Looks fixed on master. Could use a test
In [7]: df = pd.DataFrame(data={ ...: 'A': ['a1','a2',None], ...: 'B': ['b1','b2','b1'], ...: 'val': [1,2,3], ...: }) ...: print(df) ...: print('\n') ...: ...: grps = df.groupby(['A', 'B']) ...: print(grps.get_group(('a2','b1'))) A B val 0 a1 b1 1 1 a2 b2 2 2 None b1 3 KeyError: ('a2', 'b1')
WillySong
Successfully merging a pull request may close this issue.
Minimally reproducible example
Problem description
Selecting a group which doesn't appear, I obtain a group which should not exist.
Expected Output
KeyError
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.7.3.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.24.2
pytest: None
pip: 19.0.3
setuptools: 40.8.0
Cython: None
numpy: 1.16.2
scipy: 1.2.1
pyarrow: None
xarray: None
IPython: 7.4.0
sphinx: 2.0.1
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.3
openpyxl: None
xlrd: 1.2.0
xlwt: None
xlsxwriter: 1.1.7
lxml.etree: 4.3.3
bs4: None
html5lib: 1.0.1
sqlalchemy: 1.3.8
pymysql: 0.9.3
psycopg2: 2.8.3 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: