I have a DateFrame:
what I am trying to achieve is to do add 2-3 columns after checking specific conditions
The condition is
limit_a = 1000
limit_b = 500
limit_c = 2000
if df['input_amount']>limit_a and df['type']=="A":
df['approved amount'] = limit_a
df['comment'] = 'limit reached for A'
else:
df['approved amount'] = df['input_amount']
df['comment'] = 'limit not reached for A'
if df['input_amount']>limit_b and df['type']=="B":
df['approved amount'] = limit_b
df['comment'] = 'limit reached for B'
else:
df['approved amount'] = df['input_amount']
df['comment'] = 'limit not reached for B'
This wasn't working for me.
This will be the resulting output.

