title: pandas - Modify column values based on dictionary values
body: <p>I have an CSV file containing a column "State" which contains US State names in full like: "New Jersey", "California", etc.
  I want to modify this column so that they contain abbreviations instead of the full name like "NJ", "CA"... </p>
  
  <p>To do this, I already have a dictionary that maps the state name to its abbreviation</p>
  
  <pre><code>us_state_abbrev = {
  'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ', 'Arkansas': 'AR', 'California': 'CA', 'Colorado': 'CO',
  'Connecticut': 'CT', 'Delaware': 'DE', 'Florida': 'FL', 'Georgia': 'GA', 'Hawaii': 'HI', 'Idaho': 'ID',
  'Illinois': 'IL', 'Indiana': 'IN', 'Iowa': 'IA', 'Kansas': 'KS', 'Kentucky': 'KY', 'Louisiana': 'LA',
  'Maine': 'ME', 'Maryland': 'MD', 'Massachusetts': 'MA', 'Michigan': 'MI', 'Minnesota': 'MN', 'Mississippi': 'MS',
  'Missouri': 'MO', 'Montana': 'MT', 'Nebraska': 'NE', 'Nevada': 'NV', 'New Hampshire': 'NH', 'New Jersey': 'NJ',
  'New Mexico': 'NM', 'New York': 'NY', 'North Carolina': 'NC', 'North Dakota': 'ND', 'Ohio': 'OH', 'Oklahoma': 'OK',
  'Oregon': 'OR', 'Pennsylvania': 'PA', 'Rhode Island': 'RI', 'South Carolina': 'SC', 'South Dakota': 'SD',
  'Tennessee': 'TN', 'Texas': 'TX', 'Utah': 'UT', 'Vermont': 'VT', 'Virginia': 'VA', 'Washington': 'WA',
  'West Virginia': 'WV', 'Wisconsin': 'WI', 'Wyoming': 'WY'}
  </code></pre>
  
  <p>How do I loop through the column in my CSV file AND the dictionary and replace the full state name with the abbreviation?</p>
  
  <p>Here's the code I wrote but it doesn't work:</p>
  
  <pre><code>with open(emp_file, 'r', errors='ignore') as fileHandle:
  reader = csv.reader(fileHandle)
  for row in reader:
      for state, abbrev in us_state_abbrev.items():
          if row[4] == state:
              row[4] = abbrev
  </code></pre>
  
  <p>What am I doing wrong here? Please help. </p>