Answers for "pandas create column if equals"

0

pandas create column if equals

df['color'] = ['red' if x == 'Z' else 'green' for x in df['Set']]
Posted by: Guest on September-11-2021

Code answers related to "pandas create column if equals"

Python Answers by Framework

Browse Popular Code Answers by Language