I have two list, an empty list(newgr) and the other got values that has been imported from an excel sheet(gr). I'm trying to iterate through the list in a for-loop so that I can compare and change some of the values and append the values in gr that have changed with the original values into newgr. I tried this format but it wasn't working.
df = pd.read_excel("Well_Logs.xlsx", "SB16", na_values = [-999])
newgr = []
gr = df['GR'].values.tolist()
grclean = int(input('enter your clean value >')) #20 for example
grclay = int(input('enter your clay value >')) #60 for example
for i in gr:
if i < grclean:
i==grclean
newgr.append(i)
elif i > grclay:
i==grclay
newgr.append(i)
else:
newgr.append(i)
print(newgr)
I'm expecting the list to have some new values to work with, rather the same values of gr is appended to newgr.