Snippets Collections
df['color'] = ['red' if x == 'Z' else 'green' for x in df['Set']]
star

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

#python #comprehension #loop

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension