Convert Python dict into a dataframe

前端 未结 16 2573
暗喜
暗喜 2020-11-22 03:18

I have a Python dictionary like the following:

{u\'2012-06-08\': 388,
 u\'2012-06-09\': 388,
 u\'2012-06-10\': 388,
 u\'2012-06-11\': 389,
 u\'2012-06-12\':          


        
16条回答
  •  梦如初夏
    2020-11-22 03:56

    The above answer seems the simplest and works. Copied below.

        dict = {'key 1': 'value 1', 'key 2': 'value 2', 'key 3': 'value 3'}
        df=pd.DataFrame([dict])
        print(df.head())
    

提交回复
热议问题