I have created a datatable frame as follows,
DT_EX = dt.Frame({'income':[1000,2000,3000,2500,5000]})
Here i would like to add a new column(profit_or_loss) to it on a specific condition as
If the income is greater than 2500 a value 'Profit' should be filled in the newly created column or else another value 'Loss' should be in.
Here is another case:
DT_EX_1 = dt.Frame( {'domestic_income':[4500,2500,1500,4000], 'internationaL_income':[2000,5000,1000,4500]})
In a new column(profit_loss), if this condition is met domestic_income>international_income its value should be filled in as 'Profit' or else 'Loss'
Note: It's a kind of fifelse functionality in R datatable.