title: Apply function resulted in list index out of range
body: <p>I'm trying to modify an entire column of values, but I keep having issues with the list being out of range. This is my entire code:</p>
  
  <pre><code># Libraries
  import json, requests
  import pandas as pd
  from pandas.io.json import json_normalize
  
  # Set URL
  url = 'https://api-v2.themuse.com/jobs'
  
  # For loop to extract data
  for i in range(100):
      data = json.loads(requests.get(
          url=url,
          params={'page': i}
      ).text)['results']
  
  # JSON to PANDAS
  data_norm = pd.read_json(json.dumps(data))
  
  # Modify two columns' values
  data_norm.locations = data_norm.locations.apply(lambda x: [{x[0]['name']}])
  data_norm.publication_date = pd.to_datetime(data_norm.publication_date)
  </code></pre>
  
  <p>The problem here is that when I use the function </p>
  
  <pre><code>data_norm.locations = data_norm.locations.apply(lambda x: [{x[0]['name']}]) 
  </code></pre>
  
  <p>I get the following error: </p>
  
  <pre><code>IndexError: list index out of range
  </code></pre>
  
  <p>Ideally, I want to change <code>location</code> column from this:</p>
  
  <pre><code>0               [{'name': 'Seattle, WA'}]
  1    [{'name': 'San Francisco Bay Area'}]
  2             [{'name': 'Palo Alto, CA'}]
  3                  [{'name': 'Reno, NV'}]
  4                                      []
  Name: locations, dtype: object
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>0                     Seattle, WA
  1          San Francisco Bay Area
  2                   Palo Alto, CA
  3                        Reno, NV
  4                                      
  Name: locations, dtype: object
  </code></pre>