create a
dataframe quarterly sales where each
row contains the item category
item name and expenditure Group the
rows by the category and print the
total expenditure per category.
Answers
Answered by
0
Answer:
a={'Category':['Clothes','Grocerry','Mobile','TV'],'Item_Name':['Tshirt','Sugar','Apple','Sony'],'Expenditure':[1000,905,12500,230000]}
d12=pd.DataFrame(a)
b=list(d12.columns)
c=list(d12[b[0]])
for i in c:
d12a=d12.groupby('Category')
d12a.groups
f=d12a.get_group()
print(f)
print()
Explanation:
Similar questions