QQ - IDE: Pycharm - I am using the below Dataframe Sample format
Name Business SegmentID Revenue Margin OrderQuantity
James Commercial 1001 1500 100 1
Joe Consumer 1002 800 10 1
James Commercial 1003 1900 110 2
James Commercial 1004 1800 105 3
Samuel Commercial 1005 1800 105 1
I want to aggregated it in the below format
Name Revenue Margin OrderQuantity
James 5200 315 6
Joe 800 10 1
Samuel 1800 105 1
What i have done so far ?
Data import from pyodbc, passed to a pandas dataframe
df.groupby(['Name']).Revenue.sum().Margin.sum().OrderQuantity.sum()
I was Unable to get the desired output. is there something i need to be focusing on specifically while using pyodbc.