Skip to content

TST: Partial Boolean DataFrame Indexing (#17170) #17186

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 2 commits into from
Aug 7, 2017
Merged
Changes from 1 commit
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
Diff view
Diff view
Next Next commit
TST: Partial Boolean DataFrame Indexing (#17170)
  • Loading branch information
mroeschke committed Aug 7, 2017
commit c6a4c18661a1b145da4dd0ce77bcc46c8478936d
13 changes: 13 additions & 0 deletions pandas/tests/indexing/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,19 @@ 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