title: New to Python and struggling to understand specific code
body: <p>I am new to python and cannot figure out what this code does:</p>
  
  <pre><code>df.loc[(df['col1'] == y),'col2'] = 1
  </code></pre>
  
  <p>Could you kindly help me to understand it?</p>