Answers for "grouping products for sales"

1

grouping products for sales

data = Item[Item['Bill No'].duplicated(keep=False)]

# Referenced: https://stackoverflow.com/questions/27298178/concatenate-strings-from-several-rows-using-pandas-groupby
data['Grouped'] = data.groupby('Bill No')['Item Name'].transform(lambda x: ','.join(x))
data2 = data[['Ending GST Bill No', 'Grouped']].drop_duplicates()
data2.head(10)
Posted by: Guest on November-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language