My two columns having 13961 rows, based on the value in one column, i need to change the value in another column.
if data[CO BORROWER NAME'] have marked as 'NOT_AVAILABLE' my other column data['CO BORROWER_STATUS'] should be marked with the entry 'NOT_AVAILABLE'
if data[CO BORROWER NAME'] is not equal to 'NOT_AVAILABLE' and if any other value presents data['CO BORROWER_STATUS'] should be marked as 'AVAILABLE'
I have made for loop, and if condition for the same and iterated through the same. But it is taking more than 15 minutes to execute. Is there any other other easy way ?
for i in range(0,13961):
if data['CO BORROWER NAME'][i] == 'NOT_AVAILABLE':
data['CO BORROWER_STATUS'][i]='NOT_AVAILABLE'
else:
data['CO BORROWER_STATUS'][i]='AVAILABLE'
O/p expected:
data['CO BORROWER_STATUS'] column should have either 'AVAILABLE'/'NOT
AVAILABLE' based on the condition in column data['CO BORROWER NAME'] as
mentioned earlier