I have following code to rename column values of a csv
def change_tac_to_label():
df = pd.read_csv("combined.csv", delimiter=',')
tacs = df['tac']
for tac in tacs:
if float(tac) >= 0.08:
df['tac'] = "bad"
else:
df['tac'] = "good"
df.to_csv("combined_labeled.csv")
but saved csv file have all tac
column values as good
. There should be something I am missing here.
What I tried?
- I tried setting break point at if condition, condition seems to work.