title: Performing str.split on a column in a dataframe returns a SettingWithCopyWarning
body: <p>I am attempting to split a column and keep only the third item as the column value using the following</p>
  <pre><code>df1['gene_name'] = df1.loc[:,'gene_name'].str.split(';', expand=True)[2]
  </code></pre>
  <p>I have also tried these variations</p>
  <pre><code>df1['gene_name'] = df1.iloc[:,'gene_name'].str.split(';', expand=True)[2]
  
  df1['gene_name'] = df1.loc[:,'gene_name'].str.split(';', expand=True)[2]
  
  df1['gene_name'] = df1['gene_name'].str.split(';', expand=True)[2]
  
  df1['gene_name'] = df1.gene_name.str.split(';', expand=True)[2]
  </code></pre>
  <p>But it always returns this warning</p>
  <pre><code>find_target_genes.py:19: SettingWithCopyWarning: 
  A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_indexer,col_indexer] = value instead
  
  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
    df1['gene_name'] = df1.loc[:,'gene_name'].str.split(';', expand=True)[2]
  </code></pre>
  <p>I have also tried using 4 (column index) instead of gene_names but this results in an error.</p>
  <p>How can I make this work?
  I've looked through the documentation but I don't think I am fully understanding it since I can't figure out whats wrong.</p>
  <p>Here is an example of 2 of the columns I am trying to split (yes this is all in one column):</p>
  <pre><code>ID &quot;A&quot; ; version &quot;B&quot; ; name &quot;C&quot; ; source &quot;D' ;  transcript &quot;C&quot;
  ID &quot;A1&quot; ; version &quot;B1&quot; ; name &quot;C1&quot; ; source &quot;D1&quot; ;  transcript &quot;C1&quot;
  </code></pre>
  <p>I would like the column to say <code>name &quot;C&quot;</code>  only and get rid of the rest</p>