Skip to content

Commit 2a8d1c1

Browse files
committed
clean commit
1 parent ab23ccc commit 2a8d1c1

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

pandas/core/apply.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,6 @@ def agg_dict_like(self) -> DataFrame | Series:
406406

407407
arg = self.normalize_dictlike_arg("agg", selected_obj, arg)
408408

409-
print("type self:", type(self))
410-
print("type obj:", type(obj))
411409
is_groupby = isinstance(obj, (DataFrameGroupBy, SeriesGroupBy))
412410
context_manager: ContextManager
413411
if is_groupby:

pandas/core/groupby/generic.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def _wrap_applied_output(
361361
values: list[Any],
362362
not_indexed_same: bool = False,
363363
is_transform: bool = False,
364-
edge_case_jan: bool = True,
364+
skip_as_index: bool = False,
365365
) -> DataFrame | Series:
366366
"""
367367
Wrap the output of SeriesGroupBy.apply into the expected result.
@@ -411,13 +411,9 @@ def _wrap_applied_output(
411411
not_indexed_same=not_indexed_same,
412412
is_transform=is_transform,
413413
)
414-
print("yoooohohoho")
415-
print(type(self))
416-
print(type(result))
417-
418414
if isinstance(result, Series):
419415
result.name = self.obj.name
420-
if not self.as_index and not_indexed_same and edge_case_jan:
416+
if not self.as_index and not_indexed_same and not skip_as_index:
421417
result = self._insert_inaxis_grouper(result)
422418
result.index = default_index(len(result))
423419
return result
@@ -1448,7 +1444,7 @@ def _wrap_applied_output(
14481444
values: list,
14491445
not_indexed_same: bool = False,
14501446
is_transform: bool = False,
1451-
edge_case_jan: bool = False,
1447+
skip_as_index: bool = False,
14521448
):
14531449
if len(values) == 0:
14541450
if is_transform:
@@ -1513,7 +1509,7 @@ def _wrap_applied_output_series(
15131509
first_not_none,
15141510
key_index: Index | None,
15151511
is_transform: bool,
1516-
edge_case_jan: bool = False,
1512+
skip_as_index: bool = False,
15171513
) -> DataFrame | Series:
15181514
kwargs = first_not_none._construct_axes_dict()
15191515
backup = Series(**kwargs)

pandas/core/groupby/groupby.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ def _wrap_applied_output(
13081308
values: list,
13091309
not_indexed_same: bool = False,
13101310
is_transform: bool = False,
1311-
edge_case_jan: bool = True,
1311+
skip_as_index: bool = True,
13121312
):
13131313
raise AbstractMethodError(self)
13141314

@@ -1455,7 +1455,7 @@ def _aggregate_with_numba(self, func, *args, engine_kwargs=None, **kwargs):
14551455
input="dataframe", examples=_apply_docs["dataframe_examples"]
14561456
)
14571457
)
1458-
def apply(self, func, edge_case_jan=False, *args, **kwargs) -> NDFrameT:
1458+
def apply(self, func, skip_as_index=False, *args, **kwargs) -> NDFrameT:
14591459
func = com.is_builtin_func(func)
14601460

14611461
if isinstance(func, str):
@@ -1488,7 +1488,7 @@ def f(g):
14881488
with option_context("mode.chained_assignment", None):
14891489
try:
14901490
result = self._python_apply_general(
1491-
f, self._selected_obj, edge_case_jan=edge_case_jan
1491+
f, self._selected_obj, skip_as_index=skip_as_index
14921492
)
14931493
if (
14941494
not isinstance(self.obj, Series)
@@ -1521,7 +1521,7 @@ def _python_apply_general(
15211521
not_indexed_same: bool | None = None,
15221522
is_transform: bool = False,
15231523
is_agg: bool = False,
1524-
edge_case_jan: bool = False,
1524+
skip_as_index: bool = False,
15251525
) -> NDFrameT:
15261526
"""
15271527
Apply function f in python space
@@ -1554,7 +1554,7 @@ def _python_apply_general(
15541554
not_indexed_same = mutated
15551555

15561556
return self._wrap_applied_output(
1557-
data, values, not_indexed_same, is_transform, edge_case_jan
1557+
data, values, not_indexed_same, is_transform, skip_as_index
15581558
)
15591559

15601560
@final

pandas/core/resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ def func(x):
13701370
target_category=FutureWarning,
13711371
new_message=msg,
13721372
):
1373-
result = self._groupby.apply(func, edge_case_jan=False)
1373+
result = self._groupby.apply(func, skip_as_index=False)
13741374
return self._wrap_result(result)
13751375

13761376
_upsample = _apply

0 commit comments

Comments
 (0)