if a1_status, b1_status, c1_status, d1_status equal "Active" and a1, b1, c1, d1 equals "Loan" then output column "Loan_active" contains count of "Active" row wise. input dataframe looks like this.
output dataframe :
use below code to create same dataframe mentioned above in image in pandas .
import pandas as pd
df = pd.DataFrame({'a1':['Loan','Loan','Loan'],
'a1_status' : ['active','closed','active'] ,
'b1' : ['Loan','Loan','Loan'],
'b1_status' : ['active','active','active'] ,
'c1' : ['Credit','Credit','Credit'],
'c1_status' : ['closed','closed','closed'] ,
'd1' : ['Loan','Loan','Loan'],
'd1_status' : ['closed','closed','active'] ,
})
print(df)


d1_statusorLoan_acitvewhich shows in your desire table ? And the output column in your desire table doesn't fit what you want in your question. Values inc1only containCredit, which doesn't meet the given condition for generating values for the new column.