I have two lists of dict in one variable want to combine to one list of dict in one variable, how to do?
df30 = df10.merge(df21, on='id', how='inner')
df30 = df30.to_dict('records')
The variable of df30 inside have 2 lists.
[
{
'id': 2101,
'percent': -10.213240935732046
}
]
[
{
'id': 2100,
'percent': -77.0623742454728
}
]
I want to combine them into one list of dict, how do I do that?
[
{
'id': 2101,
'percent': -10.213240935732046
},
{
'id': 2100,
'percent': -77.0623742454728
}
]
or create two new variables for two lists in df30 and combine the two variables is it possible?