pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.82k stars 17.99k forks source link

ENH: apply to generate Panels with returned Frames #3551

Closed jreback closed 10 years ago

jreback commented 11 years ago

related is #1148 (the groupby) sse also #3551

useful in a case where the returned arrity is > 1 (right now not implemented)

essentially

In [3]: df = DataFrame(randn(20,2),index=date_range('20130101',periods=20,freq='min'),
                columns=list('AB'))

df.resample('15Min',how='ohlc')
NotImplementedError: 

Easy enough to create manually

In [17]: pd.Panel(dict([ (i,df[i].resample('15Min',how='ohlc')) for i in df.columns ]))
Out[17]: 
<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 2 (major_axis) x 4 (minor_axis)
Items axis: A to B
Major_axis axis: 2013-01-01 00:00:00 to 2013-01-01 00:15:00
Minor_axis axis: open to close

From this question https://groups.google.com/forum/?fromgroups=#!topic/pystatsmodels/yHSC84koetU

jreback commented 11 years ago

have a working version....but needs some refining...

jreback commented 10 years ago

closed by #1148