title: Python remove outer quotes in a list of lists made from a data frame column
body: <p>I have a pandas data frame called positive_samples that has a column called Gene Class, which is basically a pair of genes stored as a list. It looks like below</p>
  <p><a href="https://i.stack.imgur.com/qXXln.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qXXln.png" alt="enter image description here" /></a></p>
  <p>The entire data frame looks like this.</p>
  <p><a href="https://i.stack.imgur.com/cA4Ux.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cA4Ux.png" alt="enter image description here" /></a>.</p>
  <p>So the gene class column is just the other two columns in the data frame combined. I made a list using the gene class column like below. This take all the gene pair lists and make them into a single list.</p>
  <pre><code>   #convert the column to a list
     postive_gene_pairs = positive_samples[&quot;Gene Class&quot;].tolist()
  </code></pre>
  <p>This is the output.</p>
  <p><a href="https://i.stack.imgur.com/mM5Sx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mM5Sx.png" alt="enter image description here" /></a></p>
  <p>Each pair is now wrapped within double quotes, which I dont want because I loop through this list and use .loc method to locate this pairs in another data frame called new_expression which has them as  an index like this</p>
  <p><a href="https://i.stack.imgur.com/oe8W0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oe8W0.png" alt="enter image description here" /></a></p>
  <pre><code>for positive_gene_pair in positive_gene_pairs:
      print(new_expression_df.loc[[positive_gene_pair],&quot;GSM144819&quot;])
  </code></pre>
  <p>This throws a keyerror.</p>
  <p><a href="https://i.stack.imgur.com/syNtQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/syNtQ.png" alt="enter image description here" /></a></p>
  <p>And it definely because of the extra quotes that each pair is wrapped around because when I instantiate a list like below without quotes it works just fine.</p>
  <p><a href="https://i.stack.imgur.com/YDBMT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YDBMT.png" alt="enter image description here" /></a></p>
  <p>So my question is how do I remove the extra quotes to make this work with .loc? To make a list just like below, but from a data frame column?.</p>
  <pre><code>pairs = [['YAL013W','YBR103W'],['YAL011W','YMR263W']]
  </code></pre>
  <p>I tried so many workarounds like replace, strip but none of them worked for me as ideally they would work for strings but I was trying to make them work on a list, any easy solution? I just want to have a list of list like this pairs list that does not have extra single or double quotes.</p>