Skip to content
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

Setting 2D slice of a Panel #14633

Closed
AdamGleave opened this issue Nov 10, 2016 · 3 comments
Closed

Setting 2D slice of a Panel #14633

AdamGleave opened this issue Nov 10, 2016 · 3 comments
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves

Comments

@AdamGleave
Copy link
Contributor

Issue

Assigning to a Panel with two vector indexers and one scalar indexer produces unexpected behaviour: the vector indexers are zipped together, rather than the Cartesian product.

A small, complete example of the issue

p=pd.Panel(0,[0,1],[0,1],[0,1])
p.loc[[0,1],[0,1],[0]]=21
p.loc[[0,1],[0,1],0]=42
p.loc[[0,1],[0,1],0]

Actual Output

    0     1
0  42   21
1  21   42

Expected Output

     0   1
0  42  42
1  42  42

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: 06b35db python: 3.5.2.final.0 python-bits: 64 OS: Linux OS-release: 4.1.3-101.fc21.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8

pandas: 0.19.0+69.g06b35db
nose: 1.3.7
pip: 8.1.2
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: 3.6.4
bs4: 4.5.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.42.0
pandas_datareader: None

@AdamGleave
Copy link
Contributor Author

This appears to be a problem in indexing.py:maybe_convert_ix. The Cartesian product is not taken if any element in the index is not a list.

@jorisvandenbossche jorisvandenbossche added Bug Indexing Related to indexing on series/frames, not to indexes themselves Panel labels Nov 11, 2016
@jorisvandenbossche
Copy link
Member

@AdamGleave We would certainly welcome a bug fix if you can make a PR.

But note that we are planning to deprecate Panels eventually, see #13563

@jreback jreback added this to the Next Major Release milestone Jul 10, 2017
@jreback
Copy link
Contributor

jreback commented Jul 10, 2017

closing as Panels are deprecated.

@jreback jreback closed this as completed Jul 10, 2017
@jreback jreback modified the milestones: Next Major Release, won't fix Jul 11, 2017
@TomAugspurger TomAugspurger modified the milestones: won't fix, No action Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

No branches or pull requests

4 participants