I am using the below code to update a dataframe based on another one. However, it is dramatically slow. I am looking for a solution.
for inx, row in df1.iterrows():
dfTmp = df2.loc[df2['KANR'].astype(str) == row['KANR']]
if dfTmp.empty:
continue
if dfTmp.loc[dfTmp['STATUS'] == "F5"].empty is False:
timestamp = "%s %s" % (dfTmp.loc[dfTmp['STATUS'].astype(str) == "F5"].iloc[0, ]["Date"],
dfTmp.loc[dfTmp['STATUS'].astype(str) == "F5"].iloc[0, ]["Time"])
df1.set_value(inx, 'F5', timestamp)