I have a dataframe (my_data) like this:
ID col1 col2 col3
100 nan nan nan
101 nan nan nan
102 nan nan nan
103 nan nan nan
and I have a list "My_list" with one column and n rows:
[val1
val2
val3
val4]
I want to insert the list with 1 column and n rows into the dataframe in a specific column in a loop. I can not use the name of the column because in a loop the name of the headers will be changed. The output should be like this:
ID col1 col2 col3
100 nan val1 nan
101 nan val2 nan
102 nan val3 nan
103 nan val4 nan
So I need to use index or something like this. Can anyone help me?