title: Is it possible to have two conditions in pandas .ix?
body: <p>I was wondering if there is a way to have more than one conditions with .ix. More specifically, what I'm trying to do is change this:</p>
  
  <pre><code>In [66]: df_test
  Out[66]: 
        A          B         C         D         E
  0 -0.013863      False -0.546036  0.373015  1.002579
  1  1.275009          2  0.447672 -0.393775 -1.509525
  2 -0.517209          0  0.543322  2.434393  0.348002
  3  1.768921          0 -1.015705  1.121779  1.548792
  4  0.575418        NaN -1.803939  0.099772  0.508620
  5  0.722897   0.519641  0.435199 -0.059685 -0.585716
  </code></pre>
  
  <p>where:</p>
  
  <pre><code>In [67]: type(df_test.iloc[0,1])
  Out[67]: bool
  
  In [68]: type(df_test.iloc[1,1])
  Out[68]: str
  
  In [69]: type(df_test.iloc[2,1])
  Out[69]: str
  
  In [70]: type(df_test.iloc[3,1])
  Out[70]: int
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>      A          B         C         D         E
  0 -0.013863        NaN -0.546036  0.373015  1.002579
  1  1.275009          2  0.447672 -0.393775 -1.509525
  2 -0.517209          0  0.543322  2.434393  0.348002
  3  1.768921          0 -1.015705  1.121779  1.548792
  4  0.575418        NaN -1.803939  0.099772  0.508620
  5  0.722897   0.519641  0.435199 -0.059685 -0.585716
  </code></pre>
  
  <p>It seems that items in positions <code>[0,1]</code> and <code>[3,1]</code> are both == <code>False</code> and as a result, when I try <code>df_test.ix[df_test.B == False, 'B'] = np.nan</code> both of these items are turned to <code>NaN</code>.</p>
  
  <p>When I try <code>df_test.ix[df_test.B == False and type(df_test.B) == bool, 'B'] = np.nan</code> I get the following error: <code>KeyError: 'cannot use a single bool to index into setitem'</code></p>
  
  <p>Any ideas would be appreciated.</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>In [133]: df_test
  Out[133]: 
        A         B         C         D         E
  0 -0.013863     False         1  0.373015  1.002579
  1  1.275009         2  0.447672 -0.393775 -1.509525
  2 -0.517209         0         3  2.434393  0.348002
  3  1.768921         0       NaN  1.121779  1.548792
  4  0.575418       NaN  -1.80394  0.099772  0.508620
  5  0.722897  0.519641  0.435199 -0.059685 -0.585716
  ...
  
  In [134]: df_test.dtypes
  Out[134]: 
  A    float64
  B     object
  C     object
  D    float64
  E    float64
  dtype: object
  
  In [139]: type(df_test['B'][0])
  Out[139]: bool
  
  In [140]: type(df_test['B'][1])
  Out[140]: str
  
  In [141]: type(df_test['B'][2])
  Out[141]: str
  
  In [142]: type(df_test['B'][3])
  Out[142]: int
  
  In [143]: type(df_test['B'][4])
  Out[143]: float
  
  In [144]: df_test['B'] == False
  Out[144]: 
  0     True
  1    False
  2    False
  3     True
  4    False
  5    False
  6    False
  7    False
  8    False
  9    False
  Name: B, dtype: bool
  </code></pre>
  
  <p><strong>EDIT2</strong>
  See below how this is reproduced</p>
  
  <pre><code>In [226]: df_test = pd.DataFrame(np.random.randn(5,5), columns=list('ABCDE'))
  
  In [227]: df_test
  Out[227]: 
        A         B         C         D         E
  0  0.609775  0.205708 -0.015081  2.096414  0.121245
  1  1.223234 -1.299398  1.238649  0.216846 -0.789828
  2  0.446873  1.734404 -0.675568 -1.203400  0.053905
  3  0.286693 -0.080294 -0.115739 -0.195039  0.400201
  4  0.519230  1.939370 -0.424466  0.102137 -0.724420
  
  In [228]: df_test.iloc[0,1] = False
  
  In [229]: df_test.iloc[1,1] = '0'
  
  In [230]: df_test.iloc[2,1] = 0
  
  In [231]: df_test.iloc[3,1] = '2'
  
  In [232]: df_test.B == False
  Out[232]: 
  0     True
  1    False
  2     True
  3    False
  4    False
  Name: B, dtype: bool
  </code></pre>