I must be missing something, but I cannot find any guides on how to construct a pandas dataframe using both list of rows and columns. The purpose is that the row_list and col_list are updated in a loop and can hold more or less strings, but will always equal each other in length.
Using transpose works on the rows, but I'm not sure how to pass the columns in.
row_list = ['a', 'b', 'c', 'd']
col_list = ['A', 'B', 'C', 'D']
df = pd.DataFrame(row_list, columns=col_list)
>>>
raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}")
ValueError: Shape of passed values is (4, 1), indices imply (4, 4)
df = pd.DataFrame(row_list).T
>>>
0 1 2 3
a b c d
Expected Output:
A B C D
a b c d