title: Pandas opposite of fillna(0)
body: <p>Whereas <code>df.fillna(0)</code> fills all NA/NaN values with 0, is there a function to replace all <strong>non</strong>-NA/NaN values with another value, such as 1?</p>
  
  <p>If the values in my DataFrame are variable-length lists then:</p>
  
  <ul>
  <li><code>df.replace()</code> requires that the lists are the same length</li>
  <li>boolean index like <code>df[len(df) &gt; 0] = 1</code> throws <code>ValueError: cannot insert True, already exists</code></li>
  <li><code>pandas.get_dummies()</code> throws <code>TypeError: unhashable type: 'list'</code></li>
  </ul>
  
  <p>Is there a more straightforward solution?</p>