I have a dataframe which has columns like below:
MultiIndex([('Longitude', 'Field1'),
('Latitude', 'Field1'),
('Name with Name Text', 'Field1'),
('Name with Name Text', 'Field2'),
('IsPresent', 'Field1')],)
A csv example of this would be
I want to iterate through each row in the data and for each value of field I want to replace certain characters, if they exist. For example, replace 'X'
with 'Y'
. But I don't want to depend on the column name as it can change. I want to iterate over each value and strip the character. Below iteration has field names so can't use it.
for i, j in df1.iterrows():
print(j['Name with Name Text']['Field1'])