I have the following dataframe:
dct = {"A": ["M1", "M1", "M1", "M2", "M2", "M2", "M4", "M4", "M4"], 
       "B": ["S1", "S1", "S3", "S3", "S4", "S4", "S2", "S2", "S2"], 
       "C": ["a", "n", "cb", "mk", "bg", "dgd", "rb", "cb", "uyi"], 
       "D": [3, 2, 5, 8, 10, 1, 2, 2, 7], 
       "E": [4, 3, 6, 8, 9, 4, 3, 0, 8]}
df = pd.DataFrame(dct)
df would yield:
    A   B    C   D  E
0  M1  S1    a   3  4
1  M1  S1    n   2  3
2  M1  S3   cb   5  6
3  M2  S3   mk   8  8
4  M2  S4   bg  10  9
5  M2  S4  dgd   1  4
6  M4  S2   rb   2  3
7  M4  S2   cb   2  0
8  M4  S2  uyi   7  8
Now I would like to add a value to each value of each row of the dataframe as follows:
for i in range(len(df.index)):
    row = df.iloc[i, :]
    row["F"] = "TEMP_{}".format(i)
Why this doesn't work?
I have been looking into pandas documentation, And I understand that I may be getting a copy of df.iloc[i, :], but I would like to know a solution for this problem if possible
Any help is much appreciated!!


df[“F”] = “TEMP”will suffice.row["F"] = "TEMP_{}.format(i)"iis the index position?df[“F”] = [f”Temp_{elem}” for elem in some_list]?