 <p>I'd propose to write a function and use <code>pd.apply</code> like that:</p> <pre><code>import pandas as pd df = pd.DataFrame({'a': [0, 1]}) def add500ifnot0(c): if c == 0: return c else: return c + 500 df['e'] = df['a'].apply(add500ifnot0) df </code></pre>