title: pandas: Split a column on delimiter, and get unique values
body: <p>I am translating some code from R to python to improve performance, but I am not very familiar with the pandas library. </p>
  
  <p>I have a CSV file that looks like this:</p>
  
  <pre><code>O43657,GO:0005737
  A0A087WYV6,GO:0005737
  A0A087WZU5,GO:0005737
  Q8IZE3,GO:0015630 GO:0005654 GO:0005794
  X6RHX1,GO:0015630 GO:0005654 GO:0005794
  Q9NSG2,GO:0005654 GO:0005739
  </code></pre>
  
  <p>I would like to split the second column on a delimiter (here, a space), and get the unique values in this column. In this case, the code should return <code>[GO:0005737, GO:0015630, GO:0005654 GO:0005794, GO:0005739]</code>.</p>
  
  <p>In R, I would do this using the following code:</p>
  
  <pre><code>df &lt;- read.csv("data.csv")
  unique &lt;- unique(unlist(strsplit(df[,2], " ")))
  </code></pre>
  
  <p>In python, I have the following code using pandas:</p>
  
  <pre><code>df = pd.read_csv("data.csv")
  split = df.iloc[:, 1].str.split(' ')
  unique = pd.unique(split)
  </code></pre>
  
  <p>But this produces the following error:</p>
  
  <pre><code>TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>How can I get the unique values in a column of a CSV file after splitting on a delimiter in python? </p>