@@ -366,36 +366,6 @@ def _indexed_output_to_ndframe(
366
366
result .name = self .obj .name
367
367
return result
368
368
369
- def _wrap_transformed_output (
370
- self , output : Mapping [base .OutputKey , Series | ArrayLike ]
371
- ) -> Series :
372
- """
373
- Wraps the output of a SeriesGroupBy aggregation into the expected result.
374
-
375
- Parameters
376
- ----------
377
- output : dict[base.OutputKey, Union[Series, np.ndarray, ExtensionArray]]
378
- Dict with a sole key of 0 and a value of the result values.
379
-
380
- Returns
381
- -------
382
- Series
383
-
384
- Notes
385
- -----
386
- output should always contain one element. It is specified as a dict
387
- for consistency with DataFrame methods and _wrap_aggregated_output.
388
- """
389
- assert len (output ) == 1
390
-
391
- name = self .obj .name
392
- values = next (iter (output .values ()))
393
- result = self .obj ._constructor (values , index = self .obj .index , name = name )
394
-
395
- # No transformations increase the ndim of the result
396
- assert isinstance (result , Series )
397
- return result
398
-
399
369
def _wrap_applied_output (
400
370
self ,
401
371
data : Series ,
@@ -1603,36 +1573,6 @@ def _indexed_output_to_ndframe(
1603
1573
result .columns = columns
1604
1574
return result
1605
1575
1606
- def _wrap_transformed_output (
1607
- self , output : Mapping [base .OutputKey , Series | ArrayLike ]
1608
- ) -> DataFrame :
1609
- """
1610
- Wraps the output of DataFrameGroupBy transformations into the expected result.
1611
-
1612
- Parameters
1613
- ----------
1614
- output : Mapping[base.OutputKey, Union[Series, np.ndarray, ExtensionArray]]
1615
- Data to wrap.
1616
-
1617
- Returns
1618
- -------
1619
- DataFrame
1620
- """
1621
- indexed_output = {key .position : val for key , val in output .items ()}
1622
- result = self .obj ._constructor (indexed_output )
1623
-
1624
- if self .axis == 1 :
1625
- result = result .T
1626
- result .columns = self .obj .columns
1627
- else :
1628
- columns = Index (key .label for key in output )
1629
- columns ._set_names (self .obj ._get_axis (1 - self .axis ).names )
1630
- result .columns = columns
1631
-
1632
- result .index = self .obj .index
1633
-
1634
- return result
1635
-
1636
1576
def _wrap_agged_manager (self , mgr : Manager2D ) -> DataFrame :
1637
1577
if not self .as_index :
1638
1578
# GH 41998 - empty mgr always gets index of length 0
0 commit comments