Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: sheebang python 
Python :: classe statistique dataframe python 
Python :: how to get index of week in list in python 
Python :: How to efficiently create a median finder for a stream of values, in Python? 
Python :: how to give multiple option to the user and ask the same question again and again until the user tells one of the options 
Python :: pip is not recognized as an internal or external command cmd 
Python :: selenium python download mac 
Python :: remove 0 values from dataframe 
Python :: python get script path 
Python :: remove stopwords from list of strings python 
Python :: pathlib get list of files 
Python :: check if env variable exists python 
Python :: procfile heroku django 
Python :: keras auc without tf.metrics.auc 
Python :: pip install dal 
Python :: error 401 unauthorized "Authentication credentials were not provided." 
Python :: python expression factorisation 
Python :: alarm clock python 
Python :: python mod inverse 
Python :: new working version of linkchecker 
Python :: empty dataframe 
Python :: opposite of .isin pandas 
Python :: django login redirect 
Python :: python format to print dec oct hex and bin 
Python :: send email with python 
Python :: loading text file delimited by tab into pandas 
Python :: django datetimefield default 
Python :: pandas column not in list 
Python :: drop index in multiindex pandas 
Python :: reverse linked list with python 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =