title: Function doesn't change value, when applied to nested list
body: <p>I have a function which iterates over list of lists. If it finds the value, which is a list itself, it should create a string from this value and insert it instead of the original one:</p>
  
  <pre><code>def lst_to_str(lst):
  for x in lst:
      for y in x:
          i = 0
          if type(y) == list:
              x[i] = ",".join(y)
          i +=1
  return lst
  </code></pre>
  
  <p>The problem is, when I apply this function to pd.DataFrame column</p>
  
  <pre><code>df['pdns'] = df['pdns'].apply(lambda x: lst_to_str(x))
  </code></pre>
  
  <p>It returns me the original nested list:</p>
  
  <pre><code>[['a', 'b', 'c', 'd'], ['a1', 'b1', 'd1', 'c1'],['a2', 'b2', 'c2', ['d2_1', 'd2_2']]]
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>[['a', 'b', 'c', 'd'], ['a1', 'b1', 'd1', 'c1'],['a2', 'b2', 'c2', 'd2_1, d2_2']]
  </code></pre>