Skip to content

Commit 2c2dacb

Browse files
committed
improve formatting pandas-dev#28247
1 parent f1befd1 commit 2c2dacb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/core/groupby/generic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,9 +1904,8 @@ def _recast_datetimelike_result(result: DataFrame) -> DataFrame:
19041904
"""
19051905
result = result.copy()
19061906

1907-
obj_cols = [
1908-
idx for idx in range(len(result.columns)) if is_object_dtype(result.dtypes.iloc[idx])
1909-
]
1907+
obj_cols = [idx for idx in range(len(result.columns))
1908+
if is_object_dtype(result.dtypes.iloc[idx])]
19101909

19111910
# See GH#26285
19121911
for n in obj_cols:

pandas/tests/groupby/test_apply.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,5 +665,6 @@ def test_apply_datetime_issue():
665665
df = pd.DataFrame({'a': ['foo'], 'b': [datetime.today()]})
666666
result = df.groupby('a').apply(lambda x: pd.Series(['spam'], index=[42]))
667667

668-
expected = pd.DataFrame(['spam'], Index(['foo'], dtype='object', name='a'), columns=[42])
668+
expected = pd.DataFrame(['spam'], Index(['foo'], dtype='object', name='a'),
669+
columns=[42])
669670
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)