Task: Add Conditional Column to DataFrame Based on Existing Column Values
Task: Add Conditional Column to DataFrame Based on Existing Column Values: a task in Terminal-Lego-15k (Harbor dataset). You need to create a Python script that adds a new column called color to a pandas DataFrame. The color values should be assigned based on the following condition: - If Set ==…
The task
You need to create a Python script that adds a new column called `color` to a pandas DataFrame. The color values should be assigned based on the following condition: - If `Set == 'Z'`, then `color = 'green'` - Otherwise, `color = 'red'`
Part of PrimeIntellect/Terminal-Lego-15k.