You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpandasaspds=pd.Series([None, 'ad', 'bc', 'bd'], index=pd.MultiIndex.from_product([['a', 'b'], ['c', 'd']]))
s.loc['a', 'c'] # raises IndexingError: Too many indexerss.loc(axis=0)['a', 'c'] # workaround
Problem description
Similar to #14885 but, in our case, the key is indeed present in the Multi Index (but the associated value is None).
Credit for the workaround goes to @bluenote10
@jreback I understand your comment on dataframes, but not on series: there isn't really any ambiguity about which column we want? But point well taken.
Also -- wouldn't we expect s.loc[('a', 'c'), :] (or whatever other appropriate syntax) to return just None?
Code Sample, a copy-pastable example if possible
Problem description
Similar to #14885 but, in our case, the key is indeed present in the Multi Index (but the associated value is
None
).Credit for the workaround goes to @bluenote10
Expected Output
Nothing (i.e.
None
object)Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Darwin
OS-release: 17.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.23.4
pytest: 4.0.0
pip: 18.1
setuptools: 39.1.0
Cython: None
numpy: 1.14.3
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: 1.8.1
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: 2.6.4
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: 1.0.4
lxml: None
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.2.7
pymysql: None
psycopg2: 2.7.4 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: