@@ -1776,7 +1776,7 @@ def __getitem__(self, key):
1776
1776
return self ._getitem_multilevel (key )
1777
1777
elif isinstance (key , DataFrame ):
1778
1778
if key .values .dtype == bool :
1779
- return self .mask (key )
1779
+ return self .where (key )
1780
1780
else :
1781
1781
raise ValueError ('Cannot index using non-boolean DataFrame' )
1782
1782
else :
@@ -4867,7 +4867,7 @@ def combineMult(self, other):
4867
4867
"""
4868
4868
return self .mul (other , fill_value = 1. )
4869
4869
4870
- def where (self , cond , other , inplace = False ):
4870
+ def where (self , cond , other = NA , inplace = False ):
4871
4871
"""
4872
4872
Return a DataFrame with the same shape as self and whose corresponding
4873
4873
entries are from self where cond is True and otherwise are from other.
@@ -4901,21 +4901,6 @@ def where(self, cond, other, inplace=False):
4901
4901
rs = np .where (cond , self , other )
4902
4902
return self ._constructor (rs , self .index , self .columns )
4903
4903
4904
- def mask (self , cond ):
4905
- """
4906
- Returns copy of self whose values are replaced with nan if the
4907
- corresponding entry in cond is False
4908
-
4909
- Parameters
4910
- ----------
4911
- cond: boolean DataFrame or array
4912
-
4913
- Returns
4914
- -------
4915
- wh: DataFrame
4916
- """
4917
- return self .where (cond , NA )
4918
-
4919
4904
_EMPTY_SERIES = Series ([])
4920
4905
4921
4906
0 commit comments