如何通过遍历Python数据框中的每一行将计算的值存储在新列中?

我正在使用的数据框如下所示:

  vid2               FStart FEnd cap2                                               VDuration  COS  cap1
0 -_aaMGK6GGw_57_61  0      3    A man grabbed a boy from his collar and threw ...  4          2    A man and woman are yelling at a young boy and...
1 -_aaMGK6GGw_57_61  3      4    A lady is waking up a man lying on a chair and...  4          2    A man and woman are yelling at a young boy and...
2 -_hbPLsZvvo_5_8    0      1    A white dog is barking and a caption is writte...  3          2    a dog barking and cooking with her master in t...
  ...                ...    ...  ...                                                ...        ...  ...

我正在尝试计算两列cap1和cap2之间的相似性得分。但是,我想创建一个新列FSim来存储每一行​​的相似度得分。

到目前为止,我已经实现的代码是:

#The function that calculates the similarity score
def get_cosine_similarity(feature_vec_1, feature_vec_2):    
    return cosine_similarity(feature_vec_1.reshape(1, -1), feature_vec_2.reshape(1, -1))[0][0]


for i, row in merged.iterrows():
    captions = []
    captions.append(row['cap1'])
    captions.append(row['cap2'])

    for c in range(len(captions)):
        captions[c] = pre_process(captions[c])
        captions[c] = lemmatize_sentence(captions[c])

    feature_vectors = tfidf_vectorizer.transform(captions)

    fsims = get_cosine_similarity(feature_vectors[0], feature_vectors[1])
    merged['fsim'] = fsim

但是我正在为每一行存储相同的相似性分数,如下所示:

       fsim  
0  0.054464  
1  0.054464  
2  0.054464  
3  0.054464  
4  0.054464

所有行的值相同。

如何正确存储每一行​​的分数?