title: How to append values to keys in python dictionary based on dataframe rows with repeated key-value pairs
body: <p>I have ecommerce data with rows of key-value pairs, like:</p>
  
  <pre><code>row1: "ideal for":"women", "color":"blue"
  row2: "ideal for": "women", "color":"red"
  row3: "ideal for": "men", "color":"blue"
  </code></pre>
  
  <p>What I need is to create a new dictionary that will include the keys and arrays of the relevant values, e.g.:</p>
  
  <pre><code>{"ideal for": ["women","men"], "color": ["red", "blue"]}
  </code></pre>
  
  <p>When I try to append values to keys in the new dictionary, I can't seem to figure out to do it in the way so that the values do not repeat.</p>
  
  <pre><code>df.apply(lambda row: prep_text(row['product_specifications']), axis=1)
  tag_info = df['product_specifications']
  tag_info.replace('', np.nan, inplace=True)
  tag_info.dropna(inplace=True)
  tags_dict = dict()
  for row in tag_info:
       for key, value in row.items():
           if key not in tags_dict:
               tags_dict[key] = [value]
           elif value not in tags_dict.values():
               tags_dict[key].append(value)
  </code></pre>
  
  <p>Right now, I get a new dictionary that looks like this:</p>
  
  <pre><code>{"ideal for": ["women","women","men"], "color":["blue", "red", "blue"]}
  </code></pre>
  
  <p>What do I have to do so that the values do not repeat?</p>