is_max = s == s.max() | How should I read this?
<p>While studying <a href="http://pandas.pydata.org/pandas-docs/stable/style.html" rel="nofollow">Pandas Style</a>, I got to the following:</p>

<pre><code>def highlight_max(s):
    '''
    highlight the maximum in a Series yellow.
    '''
    is_max = s == s.max()
    return ['background-color: yellow' if v else '' for v in is_max]
</code></pre>

<p>How should I read <code>is_max = s == s.max()</code>?</p>

<p>The code</p>

<p><code>is_max = s == s.max()</code></p>

<p>is evaluated as</p>

<p><code>is_max = (s == s.max())</code></p>

<p>The bit in parentheses is evaluated first, and that is either <code>True</code> or <code>False</code>. The result is assigned to <code>is_max</code>.</p>

python python-2.7 pandas