python flatten dictionary to dataframe