MCPcopy
hub / github.com/pandas-dev/pandas / agg

Method agg

pandas/core/apply.py:279–300  ·  view source on GitHub ↗

Provide an implementation for the aggregators. Returns ------- Result of aggregation, or None if agg cannot be performed by this method.

(self)

Source from the content-addressed store, hash-verified

277 pass
278
279 def agg(self) -> DataFrame | Series | None:
280 """
281 Provide an implementation for the aggregators.
282
283 Returns
284 -------
285 Result of aggregation, or None if agg cannot be performed by
286 this method.
287 """
288 func = self.func
289
290 if isinstance(func, str):
291 return self.apply_str()
292
293 if is_dict_like(func):
294 return self.agg_dict_like()
295 elif is_list_like(func):
296 # we require a list, but not a 'str'
297 return self.agg_list_like()
298
299 # caller can react
300 return None
301
302 def transform(self) -> DataFrame | Series:
303 """

Callers 15

time_lambda_sumMethod · 0.45
time_frame_aggMethod · 0.45
time_frame_aggMethod · 0.45
time_frame_aggMethod · 0.45
time_str_funcMethod · 0.45
time_series_numbaMethod · 0.45
time_series_cythonMethod · 0.45

Calls 4

apply_strMethod · 0.95
agg_dict_likeMethod · 0.95
agg_list_likeMethod · 0.95
is_dict_likeFunction · 0.85

Tested by

no test coverage detected