title: Pyspark: How to remove an item from a collect_set?
body: <p> 
  In the following dataframe:</p>
  
  <pre class="lang-python prettyprint-override"><code>from pyspark.sql import functions as F
  df = sqlContext.createDataFrame([
      ("a", "code1", "name"),
      ("a", "code1", "name2"),
      ("a", "code2", "name2"),
  ], ["id", "code", "name"])
  
  df.show()
  </code></pre>
  
  <p>You can run this command to get a list of distinct values:</p>
  
  <pre class="lang-python prettyprint-override"><code>df.groupby("id").agg(F.collect_set("code")).show()
  
  +---+-----------------+
  | id|collect_set(code)|
  +---+-----------------+
  |  a|   [code2, code1]|
  +---+-----------------+
  </code></pre>
  
  <p>How do you remove an item in the above collect_set? E.g. how to remove <code>'code2'</code></p>