Skip to content

Commit

Permalink
TST: indent (pandas-dev#7002)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangchenli committed Jun 8, 2020
1 parent cfdbcf0 commit e8f181c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions pandas/tests/groupby/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest

import pandas as pd
import pandas._testing as tm
from pandas import DataFrame, Index, MultiIndex, Series, bdate_range
import pandas._testing as tm


def test_apply_issues():
Expand Down Expand Up @@ -65,8 +65,8 @@ def test_apply_trivial():

@pytest.mark.xfail(
reason="GH#20066; function passed into apply "
"returns a DataFrame with the same index "
"as the one to create GroupBy object."
"returns a DataFrame with the same index "
"as the one to create GroupBy object."
)
def test_apply_trivial_fail():
# GH 20066
Expand Down Expand Up @@ -965,9 +965,13 @@ def fn(x):

def test_apply_function_with_indexing_return_column():
# GH: 7002
df = DataFrame({'foo1': ['one', 'two', 'two', 'three', 'one', 'two'],
'foo2': np.random.randn(6)})
result = df.groupby('foo1', as_index=False).apply(lambda x: x.mean())
expected = df.groupby('foo1', as_index=False).mean()
df = DataFrame(
{
"foo1": ["one", "two", "two", "three", "one", "two"],
"foo2": np.random.randn(6),
}
)
result = df.groupby("foo1", as_index=False).apply(lambda x: x.mean())
expected = df.groupby("foo1", as_index=False).mean()
tm.assert_frame_equal(result, expected)
assert 'foo1' in result.columns
assert "foo1" in result.columns

0 comments on commit e8f181c

Please sign in to comment.