File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -430,13 +430,6 @@ def ohlc(self):
430
430
431
431
For multiple groupings, the result index will be a MultiIndex
432
432
"""
433
- if isinstance (self .obj , com .ABCDataFrame ):
434
- from pandas .tools .merge import concat
435
- return concat ((col_groupby ._cython_agg_general ('ohlc' )
436
- for _ , col_groupby in self ._iterate_column_groupbys ()),
437
- keys = self .obj .columns ,
438
- axis = 1 )
439
-
440
433
return self ._cython_agg_general ('ohlc' )
441
434
442
435
def nth (self , n ):
@@ -2245,6 +2238,20 @@ def _iterate_column_groupbys(self):
2245
2238
grouper = self .grouper ,
2246
2239
exclusions = self .exclusions )
2247
2240
2241
+ def _apply_to_column_groupbys (self , func ):
2242
+ from pandas .tools .merge import concat
2243
+ return concat ((func (col_groupby )
2244
+ for _ , col_groupby in self ._iterate_column_groupbys ()),
2245
+ keys = self .obj .columns ,
2246
+ axis = 1 )
2247
+
2248
+ def ohlc (self ):
2249
+ """
2250
+ Compute sum of values, excluding missing values
2251
+
2252
+ For multiple groupings, the result index will be a MultiIndex
2253
+ """
2254
+ return self ._apply_to_column_groupbys (lambda x : x ._cython_agg_general ('ohlc' ))
2248
2255
2249
2256
from pandas .tools .plotting import boxplot_frame_groupby
2250
2257
DataFrameGroupBy .boxplot = boxplot_frame_groupby
You can’t perform that action at this time.
0 commit comments