python list of dictionaries to pandas code example
Example 1: dataframe to list of dicts
df = pd.DataFrame({'Name': ['John', 'Sara','Peter','Cecilia'],
'Age': [38, 47,63,28],
'City':['Boston', 'Charlotte','London','Memphis']})
datadict = df.to_dict('records')
Example 2: python list of dictionaries to list
[d['value'] for d in l if 'value' in d]