I'm trying to loop through column of numbers and replace a with the associated label from another text file using the index on the text file. But it keeps returning an error
#conditions.txt has the labels while 'Reason for absence' has the numbers
with open('conditions.txt') as f:
lines = f.readlines()
ds = pd.DataFrame(lines)
index=ds.index
print(index)
newname=df['Reason for absence'].copy()
for value in newname:
for i in index:
if value in newname == index :
newname=ds