List comprehension

PHOTO EMBED

Wed Jun 30 2021 07:05:52 GMT+0000 (UTC)

Saved by @pmv #python #comprehension #loop

df['color'] = ['red' if x == 'Z' else 'green' for x in df['Set']]
content_copyCOPY