ค้นหายอดเงินคงเหลือในบัญชีที่มียอดออมทรัพย์สูงกว่ายอดออมทรัพย์เฉลี่ย
Find the checking balance of the accounts whose savings balance is higher than the average savings balance.
df_accounts = pd.DataFrame(columns=['custid', 'name']); df_checking = pd.DataFrame(columns=['balance', 'custid']); df_savings = pd.DataFrame(columns=['balance', 'custid'])
df_accounts[df_accounts['custid'].isin(df_savings[df_savings['balance'] > df_savings['balance'].mean()]['custid'])].merge(df_checking, on='custid')['balance']