Skip to content

Commit

Permalink
TST: Partial Boolean DataFrame Indexing (#17186)
Browse files Browse the repository at this point in the history
Closes gh-17170
  • Loading branch information
mroeschke authored and gfyoung committed Aug 7, 2017
1 parent 65e0451 commit 62f464f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pandas/tests/indexing/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,20 @@ def test_maybe_numeric_slice(self):
expected = [1]
assert result == expected

def test_partial_boolean_frame_indexing(self):
# GH 17170
df = pd.DataFrame(np.arange(9.).reshape(3, 3),
index=list('abc'),
columns=list('ABC'))
index_df = pd.DataFrame(1, index=list('ab'), columns=list('AB'))
result = df[index_df.notnull()]
expected = pd.DataFrame(np.array([[0., 1., np.nan],
[3., 4., np.nan],
[np.nan] * 3]),
index=list('abc'),
columns=list('ABC'))
tm.assert_frame_equal(result, expected)


class TestSeriesNoneCoercion(object):
EXPECTED_RESULTS = [
Expand Down

0 comments on commit 62f464f

Please sign in to comment.