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)
0

1 Answer 1

1

What about just doing this?

pd.DataFrame(data)

It gives you:

    name    id  value
0   peter   92  6500
1   jack    93  6000
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.