0

I have a list of dictionaries: data = [{'name': 'peter', 'id': 92, 'value': 6500},{'name': 'peter', 'id': 93, 'value': 6000},[{'name': 'jack', 'id': 93, 'value': 9500}]

and I want it to be converted to a dataframe:

peter    id   jack 
6500     92  0/NaN
6000     93   9500   

How to do that in python.

I have tried this but it is not working

df1 = pd.DataFrame(data,  columns =['name', 'value']) 
print (df1)
userD1989
  • 47
  • 1
  • 7

1 Answers1

1

What about just doing this?

pd.DataFrame(data)

It gives you:

    name    id  value
0   peter   92  6500
1   jack    93  6000
Allen Qin
  • 19,507
  • 8
  • 51
  • 67