8000 TST: Groupby/transform with grouped NaN (#9941) by mroeschke · Pull Request #14907 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

TST: Groupby/transform with grouped NaN (#9941) #14907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000 Diff view
Diff view
TST: Groupby/transform with grouped NaN (#9941)
  • Loading branch information
mroeschke committed Dec 18, 2016
commit 30c1c70d5e1e266db7e8a125c1ac4d3cd89d6da8
9 changes: 9 additions & 0 deletions pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,15 @@ def test_groupby_transform_with_int(self):
expected = DataFrame(dict(B=1, C=[2, 3, 4, 10, 5, -1]))
assert_frame_equal(result, expected)

def test_groupby_transform_with_nan_group(self):
# GH 9941
df = pd.DataFrame({'a': range(10),
'b': [1, 1, 2, 3, np.nan, 4, 4, 5, 5, 5]})
result = df.groupby(df.b)['a'].transform(max)
expected = pd.Series([1., 1., 2., 3., np.nan, 6., 6., 9., 9., 9.],
name='a')
assert_series_equal(result, expected)

def test_indices_concatenation_order(self):

# GH 2808
Expand Down
0