Pandas - Groupby One Column

Published: 24 July 2024
on channel: Learn Pandas
31
1

🔥 Free Pandas Course: https://hedaro.gumroad.com/l/tqqfq

In this video I will show you how to group by one column.

import pandas as pd

df = pd.read_clipboard()

The data is composed of 3 columns (Diagnosis, Treatment, Cost)

create our group object
group = df.groupby('Diagnosis')

sum over the group
group['Cost'].sum()


Watch video Pandas - Groupby One Column online without registration, duration hours minute second in high quality. This video was added by user Learn Pandas 24 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 31 once and liked it 1 people.