I had two lists
values = ['98', '42']
columns = ['PREC', 'TEMP']
I want to make something like this:
PREC TEMP
0 98 42
>Solution :
The below would work where you pass the values to convert it to dataframe and then use the columns params to assign columns names and then you can override the index with your required index values in the iteration
import pandas as pd
values = ['98', '42']
my_columns = ['PREC', 'TEMP']
my_index = '27/12/2021'
df = pd.DataFrame([values], columns=[my_columns])
df.rename(index={0:my_index},inplace=True)
PREC TEMP
27/12/2021 98 42