Skip to content

Commit

Permalink
fixed file modes for core/frame.py, test/test_frame.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Nov 11, 2012
1 parent 540fafd commit 030bc66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,7 @@ def __setitem__(self, key, value):
self._set_item(key, value)

def _boolean_set(self, key, value):
mask = key.values
if mask.dtype != np.bool_:
if key.values.dtype != np.bool_:
raise ValueError('Must pass DataFrame with boolean values only')

if self._is_mixed_type:
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def test_getitem_boolean(self):
self.assertRaises(ValueError, self.tsframe.__getitem__, self.tsframe)

# test df[df >0] works

bif = self.tsframe[self.tsframe > 0]
bifw = DataFrame(np.where(self.tsframe>0,self.tsframe,np.nan),index=self.tsframe.index,columns=self.tsframe.columns)
self.assert_(isinstance(bif,DataFrame))
Expand Down

0 comments on commit 030bc66

Please sign in to comment.