Skip to content

Commit

Permalink
improve formatting pandas-dev#28247
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthann committed Sep 22, 2019
1 parent f1befd1 commit 2c2dacb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1904,9 +1904,8 @@ def _recast_datetimelike_result(result: DataFrame) -> DataFrame:
"""
result = result.copy()

obj_cols = [
idx for idx in range(len(result.columns)) if is_object_dtype(result.dtypes.iloc[idx])
]
obj_cols = [idx for idx in range(len(result.columns))
if is_object_dtype(result.dtypes.iloc[idx])]

# See GH#26285
for n in obj_cols:
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/groupby/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,5 +665,6 @@ def test_apply_datetime_issue():
df = pd.DataFrame({'a': ['foo'], 'b': [datetime.today()]})
result = df.groupby('a').apply(lambda x: pd.Series(['spam'], index=[42]))

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

0 comments on commit 2c2dacb

Please sign in to comment.