I have created an empty dataframe and I have also named the columns, I didn't specify any index:
columns = ['C1','C2']
emp=pd.DataFrame(columns=columns)
I want to populate the emp dataframe with the output I get from a for loop. For example:
j=0
for i in iset:
emp[j]["C1"]=i
emp[j]["C2"]=i*i
So, as a result, assuming iset is 2, 3, 4 I would like to have:
C1 C2
index
1 2 4
2 3 9
3 4 16
How could I do it? Any suggestions are welcome, thanks for the help.