part of my data frame is as following:
personId ActivityType Time Act_delay
1473237100 remote_work_4 57651.0 57651.0
1473237100 home_2 59185.0 59185.0
1473237100 remote_work_5 65849.0 65849.0
1473237100 home_1 NaN 0.0
and I want to check if, in any row, the "ActivityType" column is equal to "home_1" and if "Time" column is NaN then replace "Act_delay" column to 10800. I have the following code"
for i, row in df.iterrows():
if row['ActivityType'] == "home_1":
if row['Time'] == np.object:
df.loc[i,'Act_delay'] = 10800.0
but it does not work. the result is the same as before. what should I do?