python flatten nested dictionary to dataframe