ค้นหาชื่อบัญชีที่มียอดฝากและเช็คยอดรวมต่ำสุด
Find the name of account that has the lowest total checking and saving balance.
df_checking = pd.DataFrame(columns=['custid', 'balance']); df_savings = pd.DataFrame(columns=['custid', 'balance']); df_accounts = pd.DataFrame(columns=['name', 'custid'])
df_accounts.merge(df_checking, on='custid').merge(df_savings, on='custid').assign(total_balance=lambda x: x['balance_x'] + x['balance_y']).nsmallest(1, 'total_balance')['name']