I have a column with values that are negative and positive. If the values are negative I want to add (24*60) to them. if they are positive they will remain the same. I have written the below code but it is throwing an error: "The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()"
I tried .any() and .all() but it is not working
if df_da.loc[i,'Time_diff'] < 0 :
df_da.loc[i, "Time_diff"]= df_da.loc[i, "Time_diff"]+(24*60)
else:
df_da.loc[i, "Time_diff"]= df_da.loc[i, "Time_diff"]
ifrequires one true/false value, not multple. It doesn't evaluate once for each row of the Series.i.