title: How to iterate over rows in a df, and permanently change a column's value by mapping?
body: <p>I want to update the values in a column of my dataframe, conditionally.</p>
  
  <p>I am dealing with an ice-cream store and the complaints it faces. The issues and the TOTAL count of these issues are stored in a dictionary:</p>
  
  <pre><code>myDict = {"Rude Staff":12, "Poor Hygiene":4, "Out of Stock":3}
  </code></pre>
  
  <p>I also have my larger df, containing a month's worth of data from the ice-cream store.</p>
  
  <pre><code>date| day | 'Rude Staff'| 'Poor Hygiene' | 'Out of Stock'&lt;br&gt;
  01/06/19 | Sat | ? | ? | ? 
  09/06/19 | Sun | ? | ? | ? 
  15/09/21 | Fri | ? | ? | ? 
  </code></pre>
  
  <p>I want to map the values of myDict to my larger df, replacing the question marks to look like so:</p>
  
  <pre><code>date | day | 'Rude Staff'| 'Poor Hygiene' | 'Out of Stock'&lt;br&gt;
  01/06/19 | Sat | 12 | 4 | 3
  09/06/19 | Sun | 12 | 4 | 3
  15/09/21 | Fri | 12 | 4 | 3
  </code></pre>
  
  <p>I've tried iterating over each row in the df, and if the value of 'Rude Staff', for example, matches any key in my dictionary, to replace the '?' with the value of that key.</p>
  
  <pre><code>for index, row in df.iterrows():
      for i in range(0, len(myDict)-1):
          if row['Rude Staff'] == myDict[i]:
              row['Rude Staff'].replace("?", myDict[myDict[i]])
  </code></pre>
  
  <p>This didn't work because iterrows doesn't permanently edit the value of rows.</p>
  
  <p>How can I map the value of my dictionary key to a column in the df based on if 'Rude Staff' in the df matches 'Rude Staff' in my dictionary?</p>