擅长:python、mysql、java
<blockquote>
<p>The or and and python statements require truth-values. For pandas
these are considered ambiguous so you should use "bitwise" | (or) or &
(and) operations:
<a href="https://stackoverflow.com/questions/36921951/truth-value-of-a-series-is-ambiguous-use-a-empty-a-bool-a-item-a-any-o">Ref</a></p>
</blockquote>
<p>将c1和c2替换为:</p>
<pre><code>c1 = (df['Mean']=='SEPA') & (df['Engagement'] == 'M')
c2 = (df['Mean']!='SEPA') & (df['Engagement'] == 'M')
</code></pre>