i try to run a code where i go through a column in a pandas dataframe like that:
for item in df['delta']:
if float(item) < 0:
print(item)
Whenever i detect an item with a value below 0, i want to add 1,000,000 and put the result back into the dataframe.
I tried something like:
df['delta'][item] = float(item) + 1000000
but then i get a key error.
How can i access the current location of the for-loop?