Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
Labels
BugIndexingRelated to indexing on series/frames, not to indexes themselves
Milestone
@dalejung

Description

@dalejung
importpandasaspdimportnumpyasnpind=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:dfforcinlist('ABC')})test1=panel.ix[:,"2002"]test1.ndim# 3type(test1)# pandas.core.frame.DataFrametest2=panel.ix[:,"2002":"2002-12-31"]test2.ndim# 3type(test2)# pandas.core.panel.Panelprintpd.__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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp