Computer Science, asked by kapoorpawanextra, 9 months ago

Create a dataframe quarterly sales where each row contain category item name and expenditure display the rows grp by category and also print total expenditure in each category

Answers

Answered by ujjwal99355
7

Answer:

import pandas as pd

data={'Category':['Medical','Grocerry','Clothes'],'Item Name':['Sanitizer','Sugar','Tshirt'],'Expenditure':[1000,500,5200]}

quarterly_sales=pd.DataFrame(data)

print(quarterly_sales)

c=quarterly_sales.groupby('Category')

print('Result after filtering')

print(c['Category','Expenditure'].sum())

Explanation:

Attachments:
Answered by dhruvgoeldg
1

Answer:

c=Quarterly_Sales.groupby('Item Category')

print(c.sum())

Similar questions