擅长:python、mysql、java
<p><strong>选项1</strong><br/>
<code>pd.Series.mask</code></p>
<pre><code>df['Full Entry'] = df.iloc[:, 1].mask(df.iloc[:, 2].isnull())
</code></pre>
<p>或者</p>
<pre><code>df['Full Entry'] = df.iloc[:, 2].mask(pd.notnull, df.iloc[:, 1])
</code></pre>
<p/>
<pre><code>df
0 1 2 Full Entry
1 10/1/2016 stringvalue 456.0 stringvalue
2 NaN anothersting NaN NaN
3 NaN and another NaN NaN
4 11/1/2016 more strings 943.0 more strings
5 NaN stringstring NaN NaN
</code></pre>
<hr/>
<p><strong>选项2</strong><br/>
<code>pd.Series.where</code>-</p>
<pre><code>df['Full Entry'] = df.iloc[:, 2].where(pd.isnull, df.iloc[:, 1])
df
0 1 2 Full Entry
1 10/1/2016 stringvalue 456.0 stringvalue
2 NaN anothersting NaN NaN
3 NaN and another NaN NaN
4 11/1/2016 more strings 943.0 more strings
5 NaN stringstring NaN NaN
</code></pre>