title: Convert string variables into ints in a dataset
body: <p>I'm trying to convert values from strings to ints in a certain column of a dataset. I tried using a for loop and even though the loop does seem to be iterating through the data it's failing to convert any of the variables. I'm certain that I'm making a super basic mistake but can't figure it out as I'm very new at this.</p>
  <p>I downloaded a data file from <a href="https://www.kaggle.com/datasets/majunbajun/himalayan-climbing-expeditions" rel="nofollow noreferrer">https://www.kaggle.com/datasets/majunbajun/himalayan-climbing-expeditions</a></p>
  <p>Then proceeded to process the data so that I can analyse it statistically.</p>
  <p>Here's the start of the code</p>
  <pre><code>#import pandas
  import pandas as pd
  #import expeditions as csv file
  exp = pd.read_csv('C:\\file\\path\\to\\expeditions.csv')
  #create subset for success vs failure
  exp_win_v_fail = exp[['termination_reason', 'basecamp_date', 'season']]
  #drop successes in dispute
  exp_win_v_fail = exp_win_v_fail[(exp_win_v_fail['termination_reason'] != 'Success (claimed)') &amp; (exp_win_v_fail['termination_reason'] != 'Attempt rumoured')]
  </code></pre>
  <p>This is the part I can't figure out</p>
  <pre><code>#recode termination reason to be binary
  for element in exp_win_v_fail['termination_reason']:
     if element == 'Success (main peak)':
       element = 1
     elif element == 'Success (subpeak)':
       element = 1
     else:
       element = 0
  </code></pre>
  <p>Any help would be very much appreciated</p>