Skip to content

Panel tshift 4853 #4864

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

Merged
merged 2 commits into from
Sep 18, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ENH: Add makePeriodPanel
  • Loading branch information
dalejung committed Sep 18, 2013
commit 695fcd5a08bf599d6bbe9e70649f5e114273676e
12 changes: 8 additions & 4 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,12 @@ def makeTimeDataFrame(nper=None):
return DataFrame(data)


def getPeriodData():
return dict((c, makePeriodSeries()) for c in getCols(K))
def getPeriodData(nper=None):
return dict((c, makePeriodSeries(nper)) for c in getCols(K))


def makePeriodFrame():
data = getPeriodData()
def makePeriodFrame(nper=None):
data = getPeriodData(nper)
return DataFrame(data)


Expand All @@ -474,6 +474,10 @@ def makePanel(nper=None):
data = dict((c, makeTimeDataFrame(nper)) for c in cols)
return Panel.fromDict(data)

def makePeriodPanel(nper=None):
cols = ['Item' + c for c in string.ascii_uppercase[:K - 1]]
data = dict((c, makePeriodFrame(nper)) for c in cols)
return Panel.fromDict(data)

def makePanel4D(nper=None):
return Panel4D(dict(l1=makePanel(nper), l2=makePanel(nper),
Expand Down