File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -1234,23 +1234,11 @@ def median(self, **kwargs):
1234
1234
Series or DataFrame
1235
1235
Median of values within each group.
1236
1236
"""
1237
- try :
1238
- return self ._cython_agg_general (
1239
- "median" ,
1240
- alt = lambda x , axis : Series (x ).median (axis = axis , ** kwargs ),
1241
- ** kwargs
1242
- )
1243
- except GroupByError :
1244
- raise
1245
- except Exception :
1246
-
1247
- def f (x ):
1248
- if isinstance (x , np .ndarray ):
1249
- x = Series (x )
1250
- return x .median (axis = self .axis , ** kwargs )
1251
-
1252
- with _group_selection_context (self ):
1253
- return self ._python_agg_general (f )
1237
+ return self ._cython_agg_general (
1238
+ "median" ,
1239
+ alt = lambda x , axis : Series (x ).median (axis = axis , ** kwargs ),
1240
+ ** kwargs
1241
+ )
1254
1242
1255
1243
@Substitution (name = "groupby" )
1256
1244
@Appender (_common_see_also )
You can’t perform that action at this time.
0 commit comments