I'd like to compare hash values in a .csv-file with the three columns image_url, code and hash. For a start i just tried to print the hash values from the rows which have code = 1.
This is my code to get the dataframe with all the rows i need
readpath = os.path.join(folder,readfile)
df = pd.read_csv(readpath)
df_code1 = df[df["code"] == 1]
but now the problems begin to start
for row in df_code1.iterrows():
try:
print(row['hash'])
except Exception as e:
print(e)
prints tuple indices must be integers or slices, not str
over and over.. when i use df_code1.rows:
instead i get the Errormessage 'DataFrame' object has no attribute 'rows'
I'm pretty sure i imported everything correctly.
May anyone tell me what i'm doing wrong?