I have two lists to be merged as a pandas dataframe. The columns would be the header of the CSV and the data contains the rows of data as a single list.
import pandas as pd
columns = [column[0] for column in cursor.description]
len(columns)
>5
data = cursor.fetchall()
len(data)
>2458
len(data[0])
>5
df = pd.DataFrame(data=data, index=None, columns=columns)
>ValueError: Shape of passed values is (1, 2458), indices imply (5, 2458).
Can someone help me merging these two lists as a pandas dataframe? Please let me know if I am missing on any other details. Thank you!