import collections

def flatten(d, parent_key=''):
    items = []
for k, v in list(d.items()):
    new_key = parent_key + '_' + k if parent_key else k
if isinstance(v, collections.MutableMapping):
    items.extend(list(flatten(v, new_key).items()))
else:
    items.append((new_key, v))
return dict(items)
flattened_records = [flatten(record) for record in results.rows]
df = DataFrame(flattened_records)
Accessing python sub list to import into pandas DataFrame