@@ -695,12 +695,7 @@ def std(self, ddof=1):
695
695
For multiple groupings, the result index will be a MultiIndex
696
696
"""
697
697
# todo, implement at cython level?
698
- if ddof == 1 :
699
- return self ._cython_agg_general ('std' )
700
- else :
701
- self ._set_selection_from_grouper ()
702
- f = lambda x : x .std (ddof = ddof )
703
- return self ._python_agg_general (f )
698
+ return np .sqrt (self .var (ddof = ddof ))
704
699
705
700
def var (self , ddof = 1 ):
706
701
"""
@@ -1332,7 +1327,6 @@ def get_group_levels(self):
1332
1327
'name' : 'group_median'
1333
1328
},
1334
1329
'var' : 'group_var' ,
1335
- 'std' : 'group_var' ,
1336
1330
'first' : {
1337
1331
'name' : 'group_nth' ,
1338
1332
'f' : lambda func , a , b , c , d : func (a , b , c , d , 1 )
@@ -1341,10 +1335,6 @@ def get_group_levels(self):
1341
1335
'count' : 'group_count' ,
1342
1336
}
1343
1337
1344
- _cython_transforms = {
1345
- 'std' : np .sqrt ,
1346
- }
1347
-
1348
1338
_cython_arity = {
1349
1339
'ohlc' : 4 , # OHLC
1350
1340
}
@@ -1455,7 +1445,6 @@ def aggregate(self, values, how, axis=0):
1455
1445
1456
1446
def _aggregate (self , result , counts , values , how , is_numeric ):
1457
1447
agg_func , dtype = self ._get_aggregate_function (how , values )
1458
- trans_func = self ._cython_transforms .get (how , lambda x : x )
1459
1448
1460
1449
comp_ids , _ , ngroups = self .group_info
1461
1450
if values .ndim > 3 :
@@ -1469,7 +1458,7 @@ def _aggregate(self, result, counts, values, how, is_numeric):
1469
1458
else :
1470
1459
agg_func (result , counts , values , comp_ids )
1471
1460
1472
- return trans_func ( result )
1461
+ return result
1473
1462
1474
1463
def agg_series (self , obj , func ):
1475
1464
try :
@@ -1669,7 +1658,6 @@ def names(self):
1669
1658
'min' : 'group_min_bin' ,
1670
1659
'max' : 'group_max_bin' ,
1671
1660
'var' : 'group_var_bin' ,
1672
- 'std' : 'group_var_bin' ,
1673
1661
'ohlc' : 'group_ohlc' ,
1674
1662
'first' : {
1675
1663
'name' : 'group_nth_bin' ,
@@ -1688,7 +1676,6 @@ def names(self):
1688
1676
def _aggregate (self , result , counts , values , how , is_numeric = True ):
1689
1677
1690
1678
agg_func , dtype = self ._get_aggregate_function (how , values )
1691
- trans_func = self ._cython_transforms .get (how , lambda x : x )
1692
1679
1693
1680
if values .ndim > 3 :
1694
1681
# punting for now
@@ -1699,7 +1686,7 @@ def _aggregate(self, result, counts, values, how, is_numeric=True):
1699
1686
else :
1700
1687
agg_func (result , counts , values , self .bins )
1701
1688
1702
- return trans_func ( result )
1689
+ return result
1703
1690
1704
1691
def agg_series (self , obj , func ):
1705
1692
dummy = obj [:0 ]
0 commit comments