Skip to content

Pandas.ix[:, "2002"] returns a DataFrame #4016

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
dalejung opened this issue Jun 24, 2013 · 6 comments · Fixed by #4507
Closed

Pandas.ix[:, "2002"] returns a DataFrame #4016

dalejung opened this issue Jun 24, 2013 · 6 comments · Fixed by #4507
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@dalejung
Copy link
Contributor

import pandas as pd
import numpy as np

ind = pd.date_range(start="2000", freq="D", periods=1000)
df = pd.DataFrame(np.random.randn(len(ind), 5), index=ind, columns=list('ABCDE'))
panel = pd.Panel({'frame_'+c:df for c in list('ABC')})

test1 = panel.ix[:, "2002"]
test1.ndim # 3
type(test1) # pandas.core.frame.DataFrame

test2 = panel.ix[:, "2002":"2002-12-31"]
test2.ndim # 3
type(test2) # pandas.core.panel.Panel

print pd.__version__
#0.11.1.dev-d7fe745

When trying to grab all the data for year 2002, I get back a DataFrame. If I use a range for the major axis, then it returns a Panel.

http://nbviewer.ipython.org/5853887

@jreback
Copy link
Contributor

jreback commented Jun 24, 2013

yep....not tested real well here; nor is some of this implemented for >2 dim, marking as a bug

@cpcloud
Copy link
Member

cpcloud commented Jun 24, 2013

ha! beat u! sorry :P

@cpcloud
Copy link
Member

cpcloud commented Jun 24, 2013

wonder if we were looking at the notebook at the same time...

@cpcloud
Copy link
Member

cpcloud commented Jun 24, 2013

@jreback should be marked as 0.11.1?

@jreback
Copy link
Contributor

jreback commented Jun 24, 2013

you can do a PR if you want, but marked as 0.12; nothing more for 0.11.1 (unless its ready and tested and can be merged right away)....no new issues

@cpcloud
Copy link
Member

cpcloud commented Jun 24, 2013

excellent.

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

Successfully merging a pull request may close this issue.

3 participants