How to convert list to row dataframe with Pandas
This is somewhat peripheral to your particular issue, but I figured I would post it in case it helps someone else out.
To convert a list of lists (and give each column a name), just pass the list to the data attribute (along with your desired column names) when instantiating the new dataframe, like so:
my_python_list = [['foo1', 'bar1'], ['foo2', 'bar2']]new_df = pd.DataFrame(columns=['my_column_name_1', 'my_column_name_2'], data=my_python_list)
result:
my_column_name_1 my_column_name_20 foo1 bar11 foo2 bar2