What is the difference between
df['Good Quality'] = [1 if x>=7 else 0 for x in df['quality']]
and
for x in df['quality']:
if x>=7:
df['Good Quality'] = 1
else:
df['Good Quality'] = 0
data frame is not changing for x>=7 if I used the second one? What is the logical error happening here?