ค้นหาจำนวนยาที่กำหนดสำหรับแต่ละยี่ห้อ
Find the number of medications prescribed for each brand.
df_medication = pd.DataFrame(columns = ['name', 'brand', 'code']); df_prescribes = pd.DataFrame(columns = ['medication'])
df = df_prescribes['medication'].value_counts(); df_medication.merge(df.rename('prescription_count'), left_on='code', right_index=True).groupby('brand')['prescription_count'].sum()