In the code below I wanted to make a = '5' be the same like saying df['Child'].iat[y] = 5. In other terms, I want a to refer to the object itself rather than becoming its value.
In visual basic you can say something like set a = df['Child'].iat[y] so I was looking for the python equivalent of this. The idea is to make the code simple and clean.
I am not interested in making 'Parent' column = 5. That's just as an example. If your solution is correct then saying a = '5 should be identical to saying df['Child'].iat[y] = 5 and should change the column value.
Thanks in advance!
import pandas as pd
df = pd.DataFrame(['MICROSOFT','CISCO', 'CISCO System', 'CISCO Systems', 'CISCO Systems CANADA', 'CISCO Systems CANADA Corporation', 'CISCO Systems CANADA Corporation Limited', 'IBM', 'Apple','Apple Corp'], columns=['Child'])
df['Parent'] = ''
display(df)
for y in range (1,df.shape[0]):
a = df['Child'].iat[y]
a = '5'
display(df)