📜  分组销售产品 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:17.038000             🧑  作者: Mango

代码示例1
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)