New course! Every coder should learn Generative AI!
Try a free lesson+ 3
Something like this might work, depending on your index:
counter = 0
for i in range(len(df)):
if df.loc[i, "Elapsed"] == "On Time":
counter += 1
df.loc[i, "On Time Count"] = counter
+ 6
Goathland1111 ,
can you please make a sample how the dataframe looks now, and what you expect to get with the new column. thanks.