Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
64 views
ubuntu2004
Kernel: Python 3 (system-wide)
import pandas as pd
df = pd.read_excel('SampleData.xlsx')
df.head()
df_central = df[df['Region'] == 'Central']

The line above groups only the data that are located in the Central region.

df_central.groupby(by = "Item").sum()

The line above shows us the unit cost and total of all the items in the Central region. So the total number of Binders sold were 5,762.