title: Pandas Dataframe Apply - lambda function appending to list
body: <p>I have a list contained in a column of a pandas dataframe. And I want to append the value in the "price_label" column to the list.</p>
  
  <p>I'm currently using a function i've made to do this, but is it the best way? I feel like I am missing something here?</p>
  
  <p>My method works, but its not pretty. Any suggestions.</p>
  
  <p>List before:</p>
  
  <pre><code>+---+--------------+-----------+-----------------------------------------+-------+------------------------------+-------------+
  |   | prodref      | prodcateg | webproddesc                             | price | categories                   | price_label |
  +---+--------------+-----------+-----------------------------------------+-------+------------------------------+-------------+
  | 0 | 1004 10-14MM | STR4      | Gold Plated Bracelet 1004 - 10-14MM     | 5.98  | [Gold, Plated, Bracelet]     | 1           |
  | 1 | 1004 16-22MM | STR4      | Gold Plated Bracelet 1004 - 16-22MM     | 5.98  | [Gold, Plated, Bracelet]     | 1           |
  | 2 | 1007 10-14MM | STR4      | Bi-Colour Bracelet 1007 - 10-14MM       | 5.98  | [BiColour, Bracelet]         | 1           |
  | 3 | 1007 16-22MM | STR4      | Bi-Colour Bracelet 1007 - 16-22MM       | 5.98  | [BiColour, Bracelet]         | 1           |
  | 4 | 1010 10-14MM | STR4      | Stainless Steel Bracelet 1010 - 10-14MM | 5.98  | [Stainless, Steel, Bracelet] | 1           |
  | 5 | 1010 16-22MM | STR4      | Stainless Steel Bracelet 1010 - 16-22MM | 5.98  | [Stainless, Steel, Bracelet] | 1           |
  | 6 | W108/22      | STR1      | Grey Calf Watch Strap (S) - W108/22     | 4.18  | [Grey, Calf, Watch]          | 1           |
  | 7 | W404/14      | STR1      | White Lizard Grain Strap (S) - W404/14  | 5.98  | [White, Lizard, Grain]       | 1           |
  | 8 | W404/18      | STR1      | White Lizard Grain Strap (S) - W404/18  | 5.98  | [White, Lizard, Grain]       | 1           |
  +---+--------------+-----------+-----------------------------------------+-------+------------------------------+-------------+
  </code></pre>
  
  <p>function :</p>
  
  <pre><code>def appendPrice(vert):
      cat_list = vert["categories"]
      cat_list.append(vert["price_label"])
      return cat_list
  
  test["categories"] = test.apply(lambda x:appendPrice(x),axis=1)  
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>+---+--------------+-----------+-----------------------------------------+-------+---------------------------------+-------------+
  |   | prodref      | prodcateg | webproddesc                             | price | categories                      | price_label |
  +---+--------------+-----------+-----------------------------------------+-------+---------------------------------+-------------+
  | 0 | 1004 10-14MM | STR4      | Gold Plated Bracelet 1004 - 10-14MM     | 5.98  | [Gold, Plated, Bracelet, 1]     | 1           |
  | 1 | 1004 16-22MM | STR4      | Gold Plated Bracelet 1004 - 16-22MM     | 5.98  | [Gold, Plated, Bracelet, 1]     | 1           |
  | 2 | 1007 10-14MM | STR4      | Bi-Colour Bracelet 1007 - 10-14MM       | 5.98  | [BiColour, Bracelet, 1]         | 1           |
  | 3 | 1007 16-22MM | STR4      | Bi-Colour Bracelet 1007 - 16-22MM       | 5.98  | [BiColour, Bracelet, 1]         | 1           |
  | 4 | 1010 10-14MM | STR4      | Stainless Steel Bracelet 1010 - 10-14MM | 5.98  | [Stainless, Steel, Bracelet, 1] | 1           |
  | 5 | 1010 16-22MM | STR4      | Stainless Steel Bracelet 1010 - 16-22MM | 5.98  | [Stainless, Steel, Bracelet, 1] | 1           |
  | 6 | W108/22      | STR1      | Grey Calf Watch Strap (S) - W108/22     | 4.18  | [Grey, Calf, Watch, 1]          | 1           |
  | 7 | W404/14      | STR1      | White Lizard Grain Strap (S) - W404/14  | 5.98  | [White, Lizard, Grain, 1]       | 1           |
  | 8 | W404/18      | STR1      | White Lizard Grain Strap (S) - W404/18  | 5.98  | [White, Lizard, Grain, 1]       | 1           |
  | 9 | W409/14      | STR1      | Pink Lizard Grain Strap (S) - W409/14   | 5.98  | [Pink, Lizard, Grain, 1]        | 1           |
  +---+--------------+-----------+-----------------------------------------+-------+---------------------------------+-------------+
  </code></pre>