title: Convert Geo json with nested lists to pandas dataframe
body: <p>I've a massive geo json in this form:</p>
  
  <pre><code> {'features': [{'properties': {'MARKET': 'Albany',
      'geometry': {'coordinates': [[[-74.264948, 42.419877, 0],
         [-74.262041, 42.425856, 0],
         [-74.261175, 42.427631, 0],
         [-74.260384, 42.429253, 0]]],
       'type': 'Polygon'}}},
    {'properties': {'MARKET': 'Albany',
      'geometry': {'coordinates': [[[-73.929627, 42.078788, 0],
         [-73.929114, 42.081658, 0]]],
       'type': 'Polygon'}}},
    {'properties': {'MARKET': 'Albuquerque',
      'geometry': {'coordinates': [[[-74.769198, 43.114089, 0],
         [-74.76786, 43.114496, 0],
         [-74.766474, 43.114656, 0]]],
       'type': 'Polygon'}}}],
   'type': 'FeatureCollection'}
  </code></pre>
  
  <p>After reading the json:</p>
  
  <pre><code>import json
  with open('x.json') as f:
      data = json.load(f)
  </code></pre>
  
  <p>I read the values into a list and then into a dataframe:</p>
  
  <pre><code>#to get a list of all markets
  mkt=set([f['properties']['MARKET'] for f in data['features']])
  
  #to create a list of market and associated lat long
  markets=[(market,list(chain.from_iterable(f['geometry']['coordinates']))) for f in data['features'] for market in mkt if f['properties']['MARKET']==mkt]
  
  df = pd.DataFrame(markets[0:], columns=['a','b'])     
  </code></pre>
  
  <p>First few rows of df are:</p>
  
  <pre><code>      a       b
  0   Albany  [[-74.264948, 42.419877, 0], [-74.262041, 42.4...
  1   Albany  [[-73.929627, 42.078788, 0], [-73.929114, 42.0...
  2   Albany  [[-74.769198, 43.114089, 0], [-74.76786, 43.11...
  </code></pre>
  
  <p>Then to unnest the nested list in column b, I used <code>pandas concat</code>:</p>
  
  <pre><code>df1 = pd.concat([df.iloc[:,0:1], df['b'].apply(pd.Series)], axis=1)
  </code></pre>
  
  <p>But this is creating 8070 columns with many NaNs. Is there a way to group all the latitudes and longitudes by the Market (column a)? A million rows by two column dataframe is desired.</p>
  
  <p>Desired op is:</p>
  
  <pre><code>mkt         lat         long 
  Albany      42.419877   -74.264948
  Albany      42.078788   -73.929627
  ..
  Albuquerque  35.105361   -106.640342
  </code></pre>
  
  <p>Pls note that the zero in the list element ([-74.769198, 43.114089, 0]) needs to be ignored.  </p>