So I am running a for loop within my code and it is not updating my dataframe. For example if I am multiplying some values in the code below and then when I try to print the head or tail it is not updated to what the new values should be. (the value started out as 135 below) Is there anyway to do this without having to make a new dataframe? Thank you so much!
for index, row in rick_sales.iterrows(): if row['Order description'] == 'Cross Connect': row['amount'] = row['amount'] * 9.33 else: row['amount'] = row['amount'] * 1.9 rick_sales.head()
12 rick Cross Connect 135.0 2021-02-22